# My Machine Learning Pipeline Cheated, and Cross-Validation Never Noticed

DevFeed: [My Machine Learning Pipeline Cheated, and Cross-Validation Never Noticed](<https://devfeed.tech/articles/my-machine-learning-pipeline-cheated-and-cross-validation-never-noticed-100398.md>)

Original publisher: [Read original article](<https://towardsdatascience.com/my-machine-learning-pipeline-cheated-and-cross-validation-never-noticed/>)

Author: Himanshu Sharma

Published: 2026-10-26T12:30:00Z

Content type: article

Language: en

Sources: [Towards Data Science](<https://devfeed.tech/sources/towards-data-science.md>)

Topics: [Machine learning](<https://devfeed.tech/topics/machine-learning.md>), [machine learning overfitting](<https://devfeed.tech/topics/machine-learning-overfitting.md>), [generalization in machine learning](<https://devfeed.tech/topics/generalization-in-machine-learning.md>), [Feature Engineering](<https://devfeed.tech/topics/feature-engineering.md>), [Predictive AI](<https://devfeed.tech/topics/predictive-ai.md>), [scikit-learn](<https://devfeed.tech/topics/scikit-learn.md>)

Tags: [artificial-inteligence](<https://devfeed.tech/tags/artificial-inteligence.md>), [automation](<https://devfeed.tech/tags/automation.md>), [cross-validation](<https://devfeed.tech/tags/cross-validation.md>), [data-science](<https://devfeed.tech/tags/data-science.md>), [machine-learning](<https://devfeed.tech/tags/machine-learning.md>), [pipeline](<https://devfeed.tech/tags/pipeline.md>), [python](<https://devfeed.tech/tags/python.md>), [validation](<https://devfeed.tech/tags/validation.md>)

## AI overview

In five synthetic churn datasets, a dtype-based scikit-learn pipeline reached 0.979 cross-validation AUC but only 0.564 on a clean holdout. The gap came from an outcome-correlated training ID, unordered region codes treated as measurements, informative missingness erased by median imputation, and dates one-hot encoded per day. Removing the ID brought cross-validation closer to holdout (0.640 vs. 0.632), but all four fixes were needed for close, stronger results: 0.833 vs. 0.826 for logistic regression. Gradient boosting also improved with all fixes (holdout AUC 0.809); some individual results were noisy. The author's automated checker flagged all four planted columns, but it was tested only on the same synthetic data, so warnings need human review and real-data validation. The practical guidance is to use a holdout that resembles future data, inspect influential features and column meaning, check whether missingness relates to the target, and handle high-cardinality text such as dates deliberately.

## Source excerpt

What an ID column, a date string, and a missing value taught me. The post My Machine Learning Pipeline Cheated, and Cross-Validation Never Noticed appeared first on Towards Data Science.