What is cross validation? Why is it used?

src: Krish Naik

Cross-validation is a model validation technique used to evaluate the performance of a model on an independent dataset. It splits the dataset into multiple subsets and iteratively trains the model on a subset and tests it on the remaining subset.

The basic idea behind cross-validation is to simulate the process of training a model on a dataset and then testing it on new, unseen data. By doing…