one_hot_errormachine: One Hot Encoding with Error machine

View source: R/utils.R

one_hot_errormachineR Documentation

One Hot Encoding with Error machine

Description

One Hot Encoding with Error machine

Usage

one_hot_errormachine(Z, size = NULL)

Arguments

Z

a vector of size N, where Z[i] value indicate the cluster membership of observation i.

size

optional parameter, indicating the number of classes (avoid some empty class problems).

Value

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

Examples

Z <- sample(1:4,10,replace=TRUE)
Z_OHE <- one_hot_errormachine(Z)
print(Z_OHE)

mimiSBM documentation built on May 29, 2024, 2:48 a.m.