The reason why cross-validation set is separated from test set
When creating a machine learning model, it is essential to have a reliable and accurate way to evaluate its performance. One commonly used technique is to separate the available data into three categories: a training set, a cross-validation set, and a testing set. While the training set is used to train the model, the cross-validation and testing sets are used to evaluate its performance.
The Purpose of Cross-Validation
The primary purpose of cross-validation is to tune the hyperparameters of the model. Hyperparameters are values that are set before training the model and cannot be learned from the data. Examples of hyperparameters include the learning rate, the number of hidden layers in a neural network, and the regularization parameter. The performance of a model can be highly sensitive to the values of these hyperparameters. Therefore, by using cross-validation, we can find the optimal values of the hyperparameters that result in the best performance on the cross-validation set.
Separating the Cross-Validation and Testing Sets
The reason why the cross-validation set and testing set are separated is to prevent "leakage" of information from the testing set into the training process. Leakage can occur when the model's hyperparameters are tuned using the performance on the testing set. If the hyperparameters are tuned based on the testing set's performance, the model will overfit to the testing set and perform poorly on new data.
By separating the cross-validation set and testing set, we ensure that the hyperparameters are tuned using the cross-validation set's performance only. Once we have optimized the hyperparameters using the cross-validation set, we can evaluate the model's performance on the testing set to obtain an unbiased estimate of its performance on new data.