This project aims to predict house prices using a linear regression model trained on a selected subset of features from the Ames Housing dataset. It uses clean machine learning practices including preprocessing pipelines and evaluation via cross-validation.
- 🎯 Goal: Predict
SalePriceof houses using features likeGrLivArea,BedroomAbvGr, andFullBath. - 🧠 Model: Linear Regression
- ⚙️ Tools Used:
scikit-learn,pandas,numpy,PowerTransformer,StandardScaler,Pipeline,ColumnTransformer
train.csv: Training data with features and targetSalePricetest.csv: Testing data used for predictions- Features used:
GrLivArea(Above ground living area in square feet)BedroomAbvGr(Number of bedrooms above ground)FullBath(Number of full bathrooms)
- Applied
PowerTransformer(Yeo-Johnson) to normalize skewed data - Scaled features using
StandardScaler - Combined steps using
ColumnTransformerandPipeline
- Built a regression pipeline using
LinearRegression - Evaluated performance using:
- Mean Squared Error (MSE)
- R² Score
- Performed 10-fold cross-validation using
cross_val_score - Averaged scores for robust model evaluation
- Generated predictions on test data
- Preserved original
Idfrom input dataset - Created a final DataFrame with:
IdPredictedsale price
- Exported as
test_output.csv
- Clone the repo:
git clone https://github.com/yourusername/house-price-prediction.git
cd house-price-prediction- Install requirements:
pip install -r requirements.txt
Run the Jupyter notebook:- Run the jupyter notebook:
jupyter notebookThis project uses data from the Kaggle House Prices - Advanced Regression Techniques competition.
Created with ❤️ by Swarnabha Ghosh
Feel free to reach out or contribute!
Email: swarnabha983@gmail.com