---
title: "What is cross-validation in machine learning?"  
description: "What is cross-validation in machine learning?"  
author: "Ravi Vishwakarma"  
published: 2026-05-30  
updated: 2026-06-09  
canonical: https://answers.mindstick.com/qa/116717/what-is-cross-validation-in-machine-learning  
category: "artificial-intelligence"  
tags: ["artificial intelligence"]  
reading_time: 1 minute  

---

# What is cross-validation in machine learning?

## What is cross-validation in machine learning?

## Answers

### Answer by Anubhav Sharma

[**Cross-validation**](https://www.mindstick.com/forum/158513/what-is-the-purpose-of-cross-validation-in-machine-learning-how-is-it-performed) is a technique used to check how well a [machine learning model](https://www.mindstick.com/articles/337321/a-step-by-step-guide-for-building-a-simple-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.


---

Original Source: https://answers.mindstick.com/qa/116717/what-is-cross-validation-in-machine-learning

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
