What is the main benefit of wrapping preprocessing and a model in a scikit-learn Pipeline?
Correct answer
D. Cross-validation refits the steps on each training fold
15 views
D. Cross-validation refits the steps on each training fold
15 views
A Pipeline chains transformers and a final estimator so that during cross-validation the transformers are refitted on each training fold only, preventing leakage of validation statistics. It also bundles the whole workflow into one object that can be passed to GridSearchCV, saved, and called with a single fit or predict. Step names form a namespace, so parameters are addressed as stepname__param in a search grid.
Asked in: NTS, PPSC IT, Interviews
Not sure why the answer is D? Ask here and get an explanation.