categorization | R Documentation |
The function which classify by k-means the values of each column of X. Then, the values of each column is set to the center of its cluster.
categorization(X, nb_levels)
X |
The matrix data |
np_levels |
The vector of the number of clusters to build in each column. |
$clustered The cluster's average of each attribute of each alternative $category The cluster's number of each attribute of each alternative
X <- matrix(rnorm(30), ncol=3)
nb_levels <- c(3, 2, 2)
X_clustered <- categorization(X, nb_levels)$clustered
X_category <- categorization(X, nb_levels)$category
X_clustered; X_category
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.