Default folds
By default, Autofit splits the rows into 8 shuffled folds, stratified by class for classification. Each fold is predicted by a model trained on the other 7, so every row gets one out-of-fold prediction. The score is the metric over those predictions. You choose the folds at setup:
The fold seed is fixed, so two sessions on the same table with the same settings use the same folds.
Your own folds
When rows are not independent, shuffled folds overstate the score. Two common cases:- Grouped rows. A customer has several rows. If one row trains the model and another validates it, the model has seen that customer.
- Rows ordered in time. A model validated on rows from before its training rows uses the future.
fold column to a copy of your CSV. Claude can write it for you at setup.
- Each non-negative value is one validation fold. A row with fold
2is predicted by a model trained on all rows whose fold is not2. - A row with a negative value only trains. It is never validated.
fold column.
- Grouped rows
- Rows ordered in time
Give all rows of one group the same fold, for example with scikit-learn’s
StratifiedGroupKFold (classification) or GroupKFold (regression) on the group column. Each group is then validated by a model that never saw it.Why the folds never change
If one experiment used other validation rows, its score would not be comparable with the others. Autofit saves the setup when the session starts. An experiment that passes other fold settings fails with an error before it fits anything.Fitting inside the fold
Every experiment is a scikit-learn pipeline that ends in TabPFN. Autofit fits the whole pipeline on the training rows of each fold, then predicts the validation rows. A target encoding, a scaler or a group statistic inside the pipeline therefore learns only from the training rows of that fold. The agent’s instructions forbid hardcoding statistics it saw in the data outside the pipeline. This protects against leakage through the pipeline. It does not protect against a leaking column in your data, such as a payment total recorded after a loan defaults. Drop those at setup. See Frame a task.Next
- Ensembling: how the out-of-fold predictions are blended.
- Score on a test set: get a score outside the session’s folds.