Cross-validation for tidylearn models
Arguments
- data
Data frame
- formula
Model formula
- method
Modeling method
- folds
Number of cross-validation folds
- metrics
Character vector of metrics to compute on each fold, passed to
tl_evaluate. IfNULL(the default),tl_evaluate's per-task defaults are used.- transform
Optional function for feature engineering that has to be refitted per fold. It is called with the training rows of each fold and must return a list with an
applyfunction (applied to both the training and assessment rows) and, optionally, aformulato fit under. Use this for anything that learns parameters from the data – PCA rotations, cluster centroids, target encodings – since fitting those before the split inflates every fold's score.- ...
Additional arguments passed to
tl_model
