What is cross-validation, and why is it used?

Cross-validation is a statistical technique used in machine learning to evaluate how well a model will perform on unseen data.