to_categorical_c: Transforming classes to one-hot encoding

View source: R/utils_general.R

to_categorical_cR Documentation

Transforming classes to one-hot encoding

Description

Function 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 Utils Developers: auto_n_cores(), create_object(), create_synthetic_units_from_matrix(), generate_id(), get_n_chunks(), get_synthetic_cases_from_matrix(), get_time_stamp(), matrix_to_array_c(), tensor_to_matrix_c()


aifeducation documentation built on Nov. 19, 2025, 5:08 p.m.