shape_set: Final preparation before ML algorithm

View source: R/shape_set.R

shape_setR Documentation

Final preparation before ML algorithm

Description

Prepare a data.table by:

  • transforming numeric variables into factors whenever they take less than thresh unique variables

  • transforming characters using generate_from_character

  • transforming logical into binary integers

  • dropping constant columns

  • Sending the data.table to set_as_numeric_matrix (when final_form == "numerical_matrix") will then allow you to get a numerical matrix usable by most Machine Learning Algorithms.

Usage

shape_set(data_set, final_form = "data.table", thresh = 10, verbose = TRUE)

Arguments

data_set

Matrix, data.frame or data.table

final_form

"data.table" or "numerical_matrix" (default to data.table)

thresh

Threshold such that a numerical column is transformed into a factor whenever its number of unique modalities is smaller or equal to thresh (numeric, default to 10)

verbose

Should the algorithm talk? (logical, default to TRUE)

Warning

All these changes will happen by reference.


ELToulemonde/dataPreparation documentation built on July 19, 2023, 11:45 a.m.