Use unsupervised pre-training before supervised learning: the predictors the formula names are projected onto their principal components, and the supervised model is fitted on the component scores.
Usage
tl_transfer_learning(
data,
formula,
pretrain_method = "pca",
supervised_method = "tree",
...
)Arguments
- data
Training data
- formula
Model formula, or a string that parses as one. The PCA is fitted on the numeric predictors it names.
- pretrain_method
Pre-training method. Only
"pca"is available:predict()has to project new rows, and PCA is the reduction that can.- supervised_method
Supervised learning method (default:
"tree", which handles both regression and classification with any number of classes)."logistic"is binary-only and errors on a response with more than two levels.- ...
Additional arguments passed to
tl_reduce_dimensions, such asn_components
