This project implements ElasticNet Regression using scikit-learn to predict house prices from a housing dataset. ElasticNet combines L1 (Lasso) and L2 (Ridge) regularization, balancing feature selection and coefficient stability, making it effective when features are correlated.
The notebook demonstrates the complete machine learning workflow, including data loading, preprocessing, model training, evaluation, and residual analysis.
ElasticNet_Regression
│
├── ElasticNet_Regression.ipynb
├── housing.csv
├── residual_distribution.png
└── README.md
- File: housing.csv
- Type: Tabular housing data
- Purpose: Used to train and evaluate an ElasticNet Regression model for house price prediction
- Python
- NumPy
- Pandas
- Matplotlib
- scikit-learn
- Load the housing dataset
- Perform train-test split
- Train an ElasticNet Regression model
- Predict house prices on test data
- Evaluate model performance using R² Score
- Analyze residual distribution
R² Score: 0.6398401841321038
Interpretation:
The model explains approximately 64% of the variance in housing prices.
By combining L1 and L2 regularization, ElasticNet maintains strong predictive
performance while improving model robustness and handling correlated features.
Residual Distribution (y_test − ridge_pred):
- Residuals are approximately normally distributed
- Indicates that regression assumptions are largely satisfied
- ElasticNet provides a balance between sparsity and stability
- ElasticNet combines the strengths of Ridge and Lasso regression
- Helps manage multicollinearity among features
- Provides stable performance with controlled model complexity
- Clone the repository
git clone https://github.com/your-username/ElasticNet_Regression.git
- Install required libraries
pip install numpy pandas matplotlib scikit-learn
- Open
ElasticNet_Regression.ipynb - Run all cells sequentially
- Tune alpha and l1_ratio using cross-validation
- Compare ElasticNet with Ridge and Lasso results
- Add RMSE and MAE evaluation metrics
