Search⌘ K
AI Features

Cross-Validation

Explore the concept of cross-validation and understand its role in selecting hyperparameters like the regularization parameter for logistic regression. Learn how to use scikit-learn's KFold and StratifiedKFold to create training and test folds that help evaluate model performance reliably. Understand the importance of data splitting, shuffling, stratification, and how these practices reduce overfitting and improve model generalization. Gain practical skills for implementing k-fold and leave-one-out cross-validation to optimize predictive models.

Choosing the regularization parameter

By now, you may suspect that we could use regularization in order to decrease the overfitting we observed when we tried to model the synthetic data in Exercise: Generating and Modeling Synthetic Classification Data. The question is, how do we choose the regularization parameter CC?, CC is an example of a model hyperparameter. Hyperparameters are different from the parameters that are estimated when a ...