This project demonstrates how linear regression models—including Linear Regression, Ridge Regression, and Lasso Regression—can be used to predict house prices using the Boston Housing dataset. The aim was to understand model behavior, compare performances, and apply regularization techniques to avoid overfitting.
The Boston Housing dataset was loaded using Scikit-learn. Basic exploratory data analysis was performed to understand feature distributions and their correlation with the target variable (house price).
The dataset was split into independent features (e.g., RM, LSTAT, CRIM) and the dependent target variable (Price) for modeling.
A simple linear regression model was trained using 5-fold cross-validation. The model achieved a mean negative mean squared error (MSE) of approximately -34.70, which indicates a reasonable baseline performance.
Ridge regression was implemented with a range of alpha values using GridSearchCV to find the best penalty term.
🔹 Best alpha value: 20
🔹 Best MSE: -34.07
This shows that applying L2 regularization helped reduce overfitting and slightly improved performance.
Lasso regression was also tested with a similar hyperparameter tuning approach.
🔹 Best alpha value: 1
🔹 Best MSE: -34.46
While Lasso didn’t outperform Ridge, it provides the added benefit of feature selection by shrinking less relevant coefficients to zero.