Description Usage Arguments Value
View source: R/clustering_algorithms.R
This function is a wrapper to kmeans in the package stats.
1 | myKmean(X, k)
|
X |
data matrix or data frame of size n x d, n observations and d features |
k |
number of clusters |
list of 3 components:
cluster
vector of integer between 1 and k containing the allocation of each point
centers
matrix (d x k) of the centers of each cluster
predict
function predicting to which cluster an observation belongs. The input can be a single observation vector or a matrix of several observations. The assigned cluster is the one with the closest center to the given observation.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.