ikmeans | R Documentation |
Performs k-means clustering on interval data, allowing for partitioning of data points into distinct clusters.
ikmeans(
x,
centers,
nstart = 10,
distance = "euclid",
trace = FALSE,
iter.max = 20
)
x |
A 3D interval array representing the data to be clustered. |
centers |
Either the number of clusters to create or a set of pre-initialized cluster centers. If a number is provided, it specifies how many clusters to create. |
nstart |
The number of times to run the k-means algorithm with different starting values in order to find the best solution (default is 10). |
distance |
A string specifying the distance metric to use: 'euclid' for Euclidean distance or 'hausdorff' for Hausdorff distance (default is 'euclid'). |
trace |
Logical value indicating whether to show progress of the algorithm (default is 'FALSE'). |
iter.max |
Maximum number of iterations allowed for the k-means algorithm (default is 20). |
A list of clustering results, including: - 'cluster': A vector indicating the cluster assignment of each data point. - 'centers': The final cluster centers. - 'totss': Total sum of squares. - 'withinss': Within-cluster sum of squares by cluster. - 'tot.withinss': Total within-cluster sum of squares. - 'betweenss': Between-cluster sum of squares. - 'size': The number of points in each cluster. - 'iter': Number of iterations the algorithm executed.
ikmeans(iaggregate(iris, col = 5), 2)
ikmeans(iaggregate(iris, col = 5), iaggregate(iris, col = 5))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.