Skip to contents

Function written in C++ transforming a vector of classes (int) into a binary class matrix.

Usage

to_categorical_c(class_vector, n_classes)

Arguments

class_vector

vector containing integers for every class. The integers must range from 0 to n_classes-1.

n_classes

int Total number of classes.

Value

Returns a matrix containing the binary representation for every class.

See also

Other Auxiliary Functions: matrix_to_array_c(), summarize_tracked_sustainability()