What is cross-validation in machine learning?

Asked 20 days ago Updated 10 days ago 84 views

1 Answer


1

Cross-validation is a technique used to check how well a machine learning model will perform on new data.

How It Works

  • The dataset is divided into several smaller parts (called folds).
  • The model is trained on some folds and tested on the remaining fold.
  • This process is repeated until every fold has been used for testing.

Why Is It Important?

  1. Gives a more reliable measure of model performance.
  2. Reduces the risk of overfitting.
  3. Makes better use of available data.

Simple Example

Suppose you have 100 student records.

  • Split them into 5 groups of 20 records each.
  • Train the model on 80 records and test on 20.
  • Repeat this 5 times with a different test group each time.

In short: Cross-validation helps ensure that a machine learning model works well on unseen data, not just on the data it was trained on.

Write Your Answer