Fitting preprocessing within each validation fold

A pipeline chains transformers with a final estimator so fitted preprocessing is learned from the same training rows on each fit.

Pipeline in practice

Learning a mean from every exam sheet before splitting leaks information. Cross-validate the entire pipeline with its scaler inside to isolate each fold.

中文

交叉验证时怎样一起拟合缩放器和模型?

Pipeline 把变换步骤和最终估计器串联,使每次拟合都在该次训练样本上学习变换。

Pipeline 应用实例

先把全部考试卷拿来求均值再分折会泄露信息。将缩放器放入管道,并把整条管道交给交叉验证即可隔离每折。

References / 参考来源

Keep reading / 继续阅读