A function to make the class column compatible with caret training function for classification. Should be used when classes are labeled as numeric and need to be transform to a factor.

ClassVarToFactor(df, class_col = class_col, name_0 = name_0, name_1 = name_1)

Arguments

df

An object of class data.frame.

class_col

A character vector with the name of the column that identify the classes.

name_0

A character vector with the name for the class==0

name_1

A character vector with the name for the class==1

Value

Returns a data.frame with the original class labels converted into factors.