powered by
Unified preprocessing functions that work with both supervised and unsupervised workflows Prepare Data for Machine Learning
tl_prepare_data( data, formula = NULL, impute_method = "mean", scale_method = "standardize", encode_categorical = TRUE, remove_zero_variance = TRUE, remove_correlated = FALSE, correlation_cutoff = 0.95 )
A list containing processed data and preprocessing metadata
A data frame
Optional formula (for supervised learning)
Method for missing value imputation: "mean", "median", "mode", "knn"
Scaling method: "standardize", "normalize", "robust", "none"
Whether to encode categorical variables (default: TRUE)
Remove zero-variance features (default: TRUE)
Remove highly correlated features (default: FALSE)
Correlation threshold for removal (default: 0.95)
Comprehensive preprocessing pipeline including imputation, scaling, encoding, and feature engineering
# \donttest{ processed <- tl_prepare_data(iris, Species ~ ., scale_method = "standardize") model <- tl_model(processed$data, Species ~ ., method = "logistic") # }
Run the code above in your browser using DataLab