"Predict Wine Quality with Regularization" Project

On the “Predict Wine Quality with Regularization” project in the ML/ AI engineer course, on the “Regularization and Hyperparameter tuning” module.

I don’t understand why on the section 11 of the project the model is fitted to the training data, and in the section 14 the model is fitted instead to all the data instead.

In the section 13 is explained that the data is first fitted only to the training data to be able to use then the test data to evaluate the performance of the model. Why wouldn’t this approach still be used in the following sections of the project?

1 Like

I was also thinking the same thing. It was weird that the training and test results were worse compared to no regularisation but turns out there was an error using the whole dataset to train.

@chipsi21 Did your results resemble mine after correcting this issue?

No Regularisation:

  • Train f1: 0.7728
  • Test f1: 0.7267

Default Regularisation (L2), No hyperparameter tuning:

  • Train f1: 0.7728
  • Test f1: 0.7267

Ridge Regularisation with fine tuning:

  • Train f1: 0.7723
  • Test f1: 0.7407

Lasso, L1, with no hyperparameter tuning:
Note( no feature elimination occurs in this case and the best C value is 1.51991108)

  • Train f1: 0.7719
  • Test f1: 0.7267 (same as no regularisation test score)

@codecademy can this issue be fixed since its all very confusing? thanks :wink:

My results do resemble yours. I still think don’t understand why would the section 14 fit the model to the whole data instead of using a train split. I understand the test split should only be used at the very end of the hyperparameter tuning process to prevent data leakage and overfitting.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.