Views
No views yet





| Cluster | Property Age | Salary | Purchase Rate | Characteristics |
|---|---|---|---|---|
| 0 | Older (50 yrs) | Low (~$29k) | 18% | Budget buyers, older properties |
| 1 | Older (33 yrs) | High (~$79k) | 22% | Affluent buyers |
| 2 | Newer (17 yrs) | Low (~$29k) | 18% | First-time buyers, new builds |
| 3 | Older (33 yrs) | Medium (~$50k) | 35% | Sweet spot - highest purchase rate |

| Model | Train R² | Test R² | Test MAE | Test RMSE | Improvement |
|---|---|---|---|---|---|
| Baseline (Part 3) | 0.1919 | 0.1945 | 0.4168 | 0.5345 | - |
| Linear Regression | 0.9847 | 0.9845 | 0.0919 | 0.1237 | +406% |
| Random Forest | 0.9999 | 1.0000 | 0.0054 | 0.0063 | +414% |
| Gradient Boosting | 0.9995 | 0.9994 | 0.0177 | 0.0236 | +414% |



| Class | Label | Count | Percentage |
|---|---|---|---|
| 0 | Low | 20,398 | 33.0% |
| 1 | Medium | 20,398 | 33.0% |
| 2 | High | 21,016 | 34.0% |

| Model | Accuracy | Precision | Recall | F1-Score |
|---|---|---|---|---|
| Logistic Regression | 99.50% | 0.9949 | 0.9949 | 0.9949 |
| Random Forest | 98.58% | 0.9855 | 0.9855 | 0.9854 |
| Gradient Boosting | 99.56% | 0.9956 | 0.9956 | 0.9956 |

| File | Description |
|---|---|
random_forest_house_price_model.pkl | Regression model (Random Forest) |
classification_model_winner.pkl | Classification model (Gradient Boosting) |
house_purchase_dataset.csv | Engineered dataset |
README.md | This documentation |
1import pickle
2
3# Load model
4with open('random_forest_house_price_model.pkl', 'rb') as f:
5 regression_model = pickle.load(f)
6
7# Predict (features must be scaled and in same format as training)
8predictions = regression_model.predict(X_scaled)1import pickle
2
3# Load model
4with open('classification_model_winner.pkl', 'rb') as f:
5 classification_model = pickle.load(f)
6
7# Predict price class (0=Low, 1=Medium, 2=High)
8price_class = classification_model.predict(X_scaled)Algorithm: RandomForestRegressor
n_estimators: 50
max_depth: 10
min_samples_split: 20
min_samples_leaf: 10
random_state: 42Algorithm: GradientBoostingClassifier
n_estimators: 50
max_depth: 3
learning_rate: 0.2
subsample: 0.8
random_state: 42