Definition
Cross-validation estimates how well a model will perform on new data. The data are split into k parts (typically 5 or 10); the model is trained k times on k − 1 parts and tested on the remaining one, and the results are averaged. It is more reliable than a single training/test split, especially for smaller datasets.
Data mining & machine learning
Error on training data is always optimistic — the model "remembers" the data. Cross-validation replaces it with a realistic estimate and also serves to choose parameters (tree depth, number of trees, regularization strength) and to compare different model types on the same footing.
For time series do not split at random but sequentially (train on the past, test on the future). With strongly imbalanced classes split with stratification so each part contains the minority class.
In Statistica
Cross-validation is built into tree methods, boosting, random forests, neural networks and clustering in the Data Mining menu (v-fold cross-validation); a training/test split is set by one variable or a random share. In the Workspace environment you compare several models at once by validated error, gain and ROC.
Related terms
- OverfittingOverfitting happens when a model learns not only the real relationships but also the random noise of the training data…
- Decision treesA decision tree splits data by a sequence of simple rules ("age > 45 and income < 30 thousand") into ever more…
- Random forests and boostingRandom forests and boosting are ensemble methods that combine hundreds of decision trees into one more accurate model.
- ROC curve and AUCThe ROC curve shows how a classifier's sensitivity (share of correctly caught positives) and false-positive rate change…
Knowledgebase guides
FAQ
- How many folds (k) should I choose?
- Usually 10; 5 is enough for big data, leave-one-out for very small sets. A higher k means a more precise estimate but longer computation.
- Is one training/test split enough?
- For large datasets yes (e.g. 70/30); for smaller ones the estimate from a single split is too random — use cross-validation.
Try it on your own data
Statistica free for 30 days
Full version, no credit card. Or get a pricing estimate in a minute.
Data mining & machine learning
Updated: September 2026.