This function convert a soft probability matrix to factor or one hot matrix.

cvtLabel(prob, idx = FALSE)

Arguments

prob

a matrix to convert.

idx

the type of output. If idx= TRUE will return the index of largest probability of each row. If idx= FALSE will return a one-hot matrix.

Value

a index of largest probability or one hot matrix.