A machine learning web app that predicts California house prices based on neighbourhood and property details.
Built as Project 3 of a 4-project Machine Learning series using the Zero to Mastery ML course as a learning foundation.
- Takes 8 neighbourhood/house inputs
- Uses a trained Random Forest Regressor to predict the house value
- Displays the estimated price in USD
- Includes example values to try out
| Metric | Score |
|---|---|
| Algorithm | Random Forest Regressor |
| Dataset | California Housing (20,640 houses) |
| Training samples | 16,512 |
| Testing samples | 4,128 |
| R² Score | ~0.80+ |
| Mean Absolute Error | ~$33,000 |
| Tool | Purpose |
|---|---|
| Python | Programming language |
| Scikit-Learn | ML model + built-in dataset |
| NumPy | Data handling |
| Flask | Web server |
| HTML & CSS | Frontend UI |
| Joblib | Saving/loading the model |
pip install flask scikit-learn numpy joblibpython3 train_model.pypython3 app.pyhttp://127.0.0.1:5000
house-price-predictor/
├── train_model.py # Loads dataset, trains and saves the model
├── app.py # Flask web server
├── model.joblib # Saved trained model (generated after training)
├── templates/
│ └── index.html # Web page with input form and result
└── static/
└── style.css # Styling
| Feature | Description |
|---|---|
| MedInc | Median income in block group (in $10,000s) |
| HouseAge | Median house age in block group (years) |
| AveRooms | Average number of rooms per household |
| AveBedrms | Average number of bedrooms per household |
| Population | Total population in the block group |
| AveOccup | Average number of people per household |
| Latitude | Geographic latitude of the block group |
| Longitude | Geographic longitude of the block group |
Affordable Area:
- Income: 2.0, Age: 40, Rooms: 4, Beds: 2, Pop: 800, Occupants: 3, Lat: 36, Lon: -120
Expensive Area (San Francisco):
- Income: 8.0, Age: 10, Rooms: 7, Beds: 3, Pop: 500, Occupants: 2, Lat: 37.77, Lon: -122.4
California Housing Dataset built into Scikit-Learn (sklearn.datasets.fetch_california_housing).
Originally from the 1990 California census.
| Project | Description | Status |
|---|---|---|
| Project 1 | Heart Disease Predictor | Done |
| Project 2 | Car Price Predictor | Done |
| Project 3 | House Price Predictor | Done |
| Project 4 | Custom Dataset Predictor | Coming soon |