AI Glossary / AI and machine learning / Intermediate
Cross-fitting
Definition
Cross-fitting is a validation technique where predictions for every data point are made by a model that never saw that point in training, giving honest estimates from the same data used to build the model.
What it means
The problem is circularity. If you train a model on your customers and then evaluate it on the same customers, it grades its own homework, and the marks are flattered.
Cross-fitting breaks the circle. Split the data into parts, train on all but one part, predict for the held-out part, and rotate until every point has an out-of-training prediction.
Cross-validation is the same idea used to estimate a model's accuracy. Cross-fitting extends it to situations where the predictions themselves feed further analysis, such as estimating an effect while partialling out confounders.
Every point's prediction is honest, made by a model that never saw it, so downstream calculations inherit no memorization bias.
For a business, cross-fitting is the discipline behind trustworthy claims like this campaign caused a 4 percent lift, where flexible models were involved in the estimation.
The idea is also called sample splitting with rotation. It uses all the data for both nuisance estimation and the final estimate, but never at the same time for the same point.
How it works
Split the data into K roughly equal folds, commonly five or ten.
For each fold, train the model or models on the remaining folds and predict only for the held-out one.
Collect the out-of-fold predictions for every point and use them in the final estimate or evaluation.
Repeat with different random splits if the estimate is sensitive, and average, because a single split can be lucky or unlucky.
Report the procedure with the result: how many folds, what was predicted, and how the predictions were used.
Keep the folds fixed within a run and record the random seed, so the whole procedure can be repeated and audited later by someone else.
Three practical examples
- Estimating a marketing campaign's effect while using flexible models to adjust for customer differences, without biasing the estimate.
- Evaluating a churn model's accuracy honestly when the same data must serve training and testing.
- Medical and economic studies combining machine learning with formal effect estimation.
Think of it this way
Think of grading essays by swapping classes: each teacher marks another teacher's students. Everyone's work is graded, but no one grades their own, so favouritism is structurally impossible.
The limit: swapping classes costs coordination. Cross-fitting costs computing time and care in keeping the folds properly separated.
Worked example
an honest lift estimate from one dataset
Suppose a retailer wants the effect of a loyalty campaign, adjusting for customer differences with a flexible model.
Estimating on the same data used to fit the adjustment model flatters the result. Instead, the team cross-fits: five folds, each customer's adjustment predicted by a model that never saw them. The figures are illustrative.
The final lift estimate is smaller than the naive one, and the team trusts it more, because the flattery channel is closed.
They note the procedure in the report, knowing the number will be challenged.
Illustrative case study
A fictional bank estimates the effect of a pricing change using machine-learned adjustments and no cross-fitting, and reports a pleasing uplift.
A review finds the adjustments partly memorized the outcome, and the corrected, cross-fitted estimate is half the size. The pricing decision is revisited before rollout.
The invented lesson: when flexible models touch causal claims, cross-fitting is not decoration. It is the difference between measuring and admiring.
Common misconceptions and mistakes
- Cross-fitting is the same as having a test set. It reuses all data for both training and evaluation, while keeping every prediction honest; a test set is a one-time version.
- It makes any estimate unbiased. It removes memorization bias, not bad data, bad design or unmeasured confounding.
- It is only for academics. Any business estimate mixing flexible models and effect claims benefits from the same discipline.
Business use
When a data team or vendor reports an effect estimated with machine learning, ask whether the predictions were cross-fitted.
Apply the principle yourself in small ways: never grade a model on data it trained on, and prefer out-of-fold predictions for any downstream analysis.
In vendor reports of causal lift, ask what share of the data was used to fit each model and whether predictions for a customer came from a model that excluded them.
Keep the procedure note short and standard: folds used, what each fold predicted, and the seed. A reader should be able to rerun the estimate and land on the same number.
People also ask
How is cross-fitting different from cross-validation?
Cross-validation estimates a model's accuracy; cross-fitting produces honest per-point predictions for further analysis.
How many folds?
Five or ten is common; more folds mean less bias per model and more computation.
Does it slow things down?
It multiplies training by the number of folds, which is usually affordable for tabular business data.
Is cross-fitting needed for simple averages?
No. It matters when flexible models feed an estimate, where in-sample fitting would bias the result.
Check your understanding
What bias does cross-fitting remove?
Answer: The flattery from letting a model's own training data be used to evaluate or adjust for it, by ensuring every point is predicted by a model that never saw it.
Related terms
Learn next
AI for Business Owners shows how to tell measured effects from flattering ones: https://aiforbusinessandlife.com/academy/ai-for-business-owners. [C2]
More in AI and machine learning
- Critic - In reinforcement learning, the critic is the part of the system that judges how good the current situation or action is, while another part, the actor...
- Cross decomposition - Cross decomposition is a family of methods that finds hidden dimensions linking two sets of measurements, such as customer survey answers and purchase...
- Cross-entropy method - The cross-entropy method is a sampling-based approach to optimization and rare-event estimation.
- Data analysis - Data analysis is the process of inspecting, cleaning and summarizing data to answer a question or support a decision, ranging from simple totals and charts...
- Data augmentation - Data augmentation is the practice of creating extra training examples by changing existing ones in ways that keep their meaning, such as flipping or...
- Data-driven model - A data-driven model is a model whose relationships or parameters are learned substantially from observed data.
Sources
[S24] scikit-learn documentation, Glossary of Common Terms and API Elements. Full URLs are in the source ledger. Verified 11 October 2026.
Previous: Cross-entropy method Next: Cross-industry standard process for data mining