What is Cross-validation?
In Turkish: Çapraz doğrulama · Topic: Data and evaluation
A method that splits the data into several parts and, in each round, tests on a different part while training on the rest. The average over the rounds gives a more reliable estimate of performance than a single split.
How does it work?
The most common form is k-fold cross-validation. The data is divided into, say, five equal parts. In the first round, four parts are used for training and the remaining one for testing; in the next round, the held-out part changes. After five rounds every part has served as the test part once, and the five results are averaged. The spread between results also shows how stable the model is. For time series, the order is preserved when splitting so that the future never trains the past.
Why does it matter?
When data is scarce, the result of a single validation split can depend on luck, and cross-validation reduces that risk. It is widely used for model selection and hyperparameter tuning. The cost is that the model must be trained several times, which is impractical for very large models.
Example
A researcher with a dataset of a few hundred patients measures a disease-prediction model with five-fold cross-validation and reports the average result.
FAQ
Does cross-validation replace a test set?
Usually not. It is mostly used for model selection and tuning, and because those choices rely on the same data, it is good practice to keep a separate test set for the final measurement.
Why is it rarely used with large language models?
Every round requires training the model from scratch. Since even one training run of a large language model is very costly, the method is impractical, and fixed held-out sets are used instead.