This project predicts home sale prices for Kaggle's House Prices: Advanced Regression Techniques competition.
The final submission achieved a 0.12053 RMSLE score on the Kaggle leaderboard.
The model blends four regressors:
- XGBoost (20%)
- Lasso regression (30%)
- Gradient Boosting regression (30%)
- CatBoost (20%)
It also creates useful housing features, including total square footage, bathrooms, porch area, house age, remodel age, amenity flags, and quality scores.
| File | Purpose |
|---|---|
train_model.py |
Trains the models and creates predictions. |
train.csv |
Training data with the SalePrice target. |
test.csv |
Test data used for predictions. |
submission.csv |
Generated Kaggle submission file. |
data_description.txt |
Description of the dataset columns. |
Create a virtual environment and install the required packages:
python3 -m venv .venv
source .venv/bin/activate
pip install numpy pandas scikit-learn xgboost catboostOn macOS, XGBoost may require OpenMP:
brew install libompFrom the project folder, run:
python train_model.pyThe script runs five-fold cross-validation, trains the ensemble on all training data, and saves predictions to submission.csv.
The submission file has two columns:
Id,SalePrice
1461,118746.34550306523
Upload submission.csv to Kaggle to receive a leaderboard score.
- The model predicts
log1p(SalePrice), which matches the competition's RMSLE evaluation. - Missing numeric values are filled with the median and missing categorical values with the most common value.
- Categorical values are one-hot encoded for most models; CatBoost handles categories directly.