Results¶
Model Comparison¶
Three models were evaluated on a held-out test set (20% of the Ames Housing dataset, stratified by sale price range). The primary evaluation metric is Root Mean Squared Error (RMSE), which penalises large prediction errors more heavily than small ones — appropriate for a pricing problem where a $50,000 miss is disproportionately worse than a $5,000 miss.
| Model | RMSE | R² |
|---|---|---|
| Linear Regression | Higher | Lower |
| Ridge Regression | Moderate | Moderate |
| Random Forest | Lowest | Highest |
Note
Exact metric values are available in the training notebook (house-price-prediction.ipynb). The table above reflects relative performance across the three models.
Why Random Forest Won¶
Linear and Ridge regression both assume that the relationship between each feature and sale price is additive and roughly linear. That assumption doesn't hold in housing data.
Consider OverallQual. At lower quality scores, incremental improvements in quality produce modest price gains. At higher quality scores (8–10), the same increment produces substantially larger gains — luxury buyers pay a premium that compounds. A linear model assigns a single coefficient to OverallQual and applies it uniformly across the range. A Random Forest learns different decision rules for different quality bands and applies them conditionally.
The same dynamic applies to area features. A 200 sq ft increase in a 1,000 sq ft property (a 20% gain) is a meaningfully different event than a 200 sq ft increase in a 5,000 sq ft property (a 4% gain). Random Forest captures this through tree splits; linear models cannot.
Production Decision¶
The Random Forest model was deployed in app.py. Ridge was included as a trained artefact (RidgeModel.pkl) in case interpretability is needed — Ridge coefficients can be inspected directly to understand which features are driving a prediction, whereas Random Forest predictions are less immediately transparent.
Limitations¶
Geographic scope. The model was trained exclusively on Ames, Iowa data. Predictions for properties in other markets will be unreliable.
Temporal scope. The dataset captures a specific period of the Ames housing market. The model has no awareness of macroeconomic conditions, interest rates, or market trends beyond what was present in the training data.
Point estimates only. The app returns a single predicted value with no uncertainty bound. In practice, prediction intervals would be more useful — a range of likely sale prices rather than a single number.
Feature subset. Only 12 of the dataset's 79 features are used. Higher accuracy is likely achievable with more complete feature engineering, but at the cost of a more complex user interface.