This project is a complete, end-to-end MLOps system designed to predict housing prices in Ames, Iowa. It follows a modern software engineering and machine learning workflow, encompassing everything from data exploration and model training to API development, containerization with Docker, and automated deployment to the AWS cloud.
The core of the project is a Gradient Boosting (XGBoost) model, a high-performance algorithm renowned for its accuracy on tabular data.
The model was evaluated on an unseen test set (20% of the original data). The performance metrics indicate a highly accurate and reliable model.
- R-squared (R²): 0.9037
- This means the model can explain approximately 90.4% of the variance in the house sale prices.
- Root Mean Squared Error (RMSE): 0.1341
- This is the average prediction error on the log-transformed sale prices.
| Metric | Score | Description |
|---|---|---|
| R-squared (R²) | 0.9037 |
Explains 90.4% of price variance. |
| RMSE (on log scale) | 0.1341 |
Low average prediction error. |
| Component | Technology/Library |
|---|---|
| Data Science | Pandas, NumPy, Scikit-learn |
| ML Model | XGBoost |
| Backend API | FastAPI |
| Web UI | Streamlit |
| Containerization | Docker |
| Testing | Pytest |
| Automation | GitHub Actions |
| Cloud Deployment | AWS (Elastic Beanstalk, S3, ECR) |
| Version Control | Git & GitHub |
This project is configured with a complete CI/CD pipeline using GitHub Actions. On every push to the main branch, the following automated workflow is triggered:
- Run Tests: The
pytestsuite is executed to ensure code quality and prevent regressions. - Build & Push: A new Docker image is built and pushed to a private Amazon ECR repository.
- Deploy: The new image is automatically deployed to the AWS Elastic Beanstalk environment, updating the live application.
To run this project locally, follow these steps:
- Python 3.11+
- Docker Desktop
git clone [https://github.com/Murci20965/real_estate_price_predictor.git](https://github.com/Murci20965/real_estate_price_predictor.git)
cd real_estate_price_predictor# Create and activate virtual environment
python -m venv venv
venv\Scripts\activate
# Install dependencies and the project in editable mode
pip install -r requirements.txt
pip install -e .python -m src.trainTerminal 1: Start the FastAPI Backend
uvicorn app.main:app --reloadTerminal 2: Start the Streamlit UI
streamlit run ui/interface.pyTo run the automated unit tests, first ensure you have installed the testing framework:
pip install pytestThen, run the following command from the project root:
pytest- Monitoring: Integrate Prometheus and Grafana for live monitoring of the deployed application's performance and health.
- Advanced Feature Engineering: Experiment with more complex features to further improve model accuracy.
- Hyperparameter Tuning: Implement an automated hyperparameter tuning pipeline to find the optimal model settings.