Clustering Matrix : One hot encoding

CEM(Z)

Arguments

Z

a matrix N x K, with probabilities to belong of a cluster in rows for each observation.

Value

Z a matrix N x K One-Hot-Encoded by rows, where K is the number of clusters.

Examples

Z <- matrix(rnorm(12),3,4)
Z_cem <- CEM(Z)
print(Z_cem)
#>      [,1] [,2] [,3] [,4]
#> [1,]    0    0    0    1
#> [2,]    0    0    1    0
#> [3,]    0    1    0    0