A hands-on machine learning project to predict house prices based on features like living area, bedrooms, and bathrooms. Built using Python and shared on LinkedIn to showcase my journey in data science and ML π―
π LinkedIn Post
Check out my project announcement and insights
βββ train.csv
βββ house_price_prediction.py
βββ README.md
βββ requirements.txt
βββ visuals/
βββ actual_vs_predicted.png
- Objective: Predict house sale prices using a Linear Regression model.
- Dataset: Kaggle's "House Prices: Advanced Regression Techniques" (
train.csv). - Features Used:
GrLivArea: Above grade living area (sq ft)BedroomAbvGr: Number of bedroomsFullBath: Number of full bathrooms
- Target:
SalePrice
- Data Cleaning: Handled missing values with mean imputation.
- Exploratory Data Analysis (EDA): Visualized relationships between features and target.
- Model Training: Trained a Linear Regression model using scikit-learn.
- Evaluation: Assessed performance using Mean Squared Error (MSE) and RΒ² score.
- Visualization: Generated scatter plot comparing actual vs predicted prices for interpretability.
| Library | Use Case |
|---|---|
pandas |
Data loading & manipulation |
numpy |
Numerical operations |
matplotlib |
Plotting and visualization |
seaborn |
Statistical visualizations |
scikit-learn |
Machine learning & evaluation |
-
Clone the repository
git clone https://github.com/SumanSekhar-Sahoo/House-Price-Prediction.git cd House-Price-Prediction
-
Install dependencies
pip install -r requirements.txt
-
Download dataset
- Get
train.csvfrom Kaggle's House Prices competition - Place it in the repo root directory
- Get
-
Run the script
python house_price_prediction.py
-
View results
- Printed MSE & RΒ² in terminal
- A scatter plot comparing actual vs predicted prices will be displayed or saved to
visuals/
Mean Squared Error: 1.97e+09
RΒ² Score: 0.72
(Actual values may vary depending on data split)
- Add more advanced features and feature engineering
- Experiment with regularized regression (Ridge, Lasso), tree-based models (Random Forest, XGBoost)
- Deploy model as a web app using Flask, FastAPI, or Streamlit
Suman Sekhar Sahoo
Distributed under the MIT License. See LICENSE for more details.
