categorization: categorization

View source: R/utils.R

categorizationR Documentation

categorization

Description

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.

Usage

categorization(X, nb_levels)

Arguments

X

The matrix data

np_levels

The vector of the number of clusters to build in each column.

Value

$clustered The cluster's average of each attribute of each alternative $category The cluster's number of each attribute of each alternative

Examples

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

AntoineDubois/sdcv2 documentation built on May 16, 2024, 3:23 p.m.