Regularization in Linear
Regression Using ML Libraries
Here is a structured lab activity for you to understand regularization in linear
regression using ML libraries. We will use scikit-learn for this purpose.
Instructions:
1. In assignment.py, fill up the #TODO sections (initializing the
model, training the model and predicting on test data). Keep the variable
names as it is defined.
2. Ensure the code runs without errors and calculates the Mean Squared
Error (MSE) for Linear Regression, Ridge Regression, and Lasso
Regression.
3. Open terminal and run python test_case.py
4. Your MSE values will be printed in the terminal. If the output is OK, you
have successfully trained your model and passed the test cases.
Files to submit:
1. assignment.py file
2. Output in terminal screenshot in .png or .jpg format
Teaching Assistant: Sriraksha M S
Mail:
[email protected]