kmeans

Ik = kmeans(I::GMTimage, k=5; seeds=nothing, maxiter=100, tol=1e-7, V=false) -> GMTimage

Compute a k-means clustering on an RGB image I. It produces a fixed number of clusters, each associated with a center, and each RGB color is assigned to a cluster with the nearest center.

kmeans(X::Union{GMTdataset, Matrix{<:Real}}, k=3; seeds=nothing, maxiter=100, tol=1e-7,
       raw::Bool=false, V=false) -> Vector{GMTdataset} | idx, centers, counts

This method accepts a M-by-d matrix or a \(GMTdataset\) where columns represent the data points and rows the d-dimensional data point.

Example

    D = gmtread(TESTSDIR * "iris.dat");
    Dk = kmeans(D, k=3)     # Unsupervised segment data into 3 clusters.

Source Code

This function has multiple methods:

See Also