Spaces:
Sleeping
Sleeping
| title: Zürich Apartment Price Predictor | |
| emoji: 🏠 | |
| colorFrom: blue | |
| colorTo: red | |
| sdk: gradio | |
| sdk_version: 6.8.0 | |
| app_file: app.py | |
| pinned: false | |
| short_description: Machine Learning Apartment Rent Price Predictor for Zurich | |
| # Model Iterations Documentation | |
| ## Task: Apartment Price Prediction (Regression) | |
| --- | |
| ## Summary of Iterative Process | |
| | Iteration | Objective | Key Changes | Models Used | CV Mean R² | CV Std Dev | Test MAE (CHF) | Fit Diagnosis | | |
| |-----------|-----------|-------------|-------------|------------|------------|----------------|---------------| | |
| | **1** | Build baseline model | - Basic cleaning<br>- 7 numerical features<br>- Train-test split (80/20)<br>- 5-fold CV | Linear Regression<br>Random Forest (n_estimators=100) | 0.429 (LR)<br>0.441 (RF) | 0.073 (LR)<br>0.075 (RF) | 549.90 (LR)<br>553.98 (RF) | ☐ Overfitting ☑ Underfitting ☐ Good Fit | | |
| | **2** | Improve through feature engineering | - 7 new features created<br>- Feature scaling (Ridge)<br>- Hyperparameter tuning<br>- 5-fold CV | Ridge (alpha=10.0)<br>Random Forest (n_estimators=200, max_depth=15)<br>Gradient Boosting (n_estimators=150, max_depth=5) | 0.461 (Ridge)<br>0.481 (RF)<br>0.521 (GB) | 0.073 (Ridge)<br>0.070 (RF)<br>0.068 (GB) | 541.11 (Ridge)<br>544.92 (RF)<br>537.78 (GB) | ☐ Overfitting ☐ Underfitting ☑ Good Fit | | |
| --- | |
| ## Notes | |
| **Metric:** MAE (Mean Absolute Error), R² (5-Fold Cross-Validation) | |
| **Created Features:** | |
| - rooms_per_sqm: Raumdichte (Zimmer pro m²) | |
| - wealth_index: Wohlstandsindikator (tax_income × emp normalisiert) | |
| - is_zurich_city: Binär-Feature für Zürich Stadt (PLZ 8000-8099) | |
| - pop_emp_ratio: Bevölkerungs-Arbeitsplatz-Verhältnis | |
| - log_area: Log-Transformation der Wohnfläche | |
| - log_pop: Log-Transformation der Bevölkerung | |
| - log_tax_income: Log-Transformation des Steuereinkommens | |
| **Final Selected Features:** | |
| - area (28.7% importance) | |
| - log_area (25.0% importance) | |
| - is_zurich_city (13.0% importance) | |
| - rooms_per_sqm (12.2% importance) | |
| - rooms, log_pop, pop_dens, pop, pop_emp_ratio, log_tax_income, emp, wealth_index, tax_income, frg_pct | |
| **Final Model:** Gradient Boosting Regressor | |
| **Reason for Selection:** | |
| Best R² score (0.521) and lowest MAE (537.78 CHF). Consistent performance between CV and test set with lowest standard deviation (±67.62 CHF), indicating stable predictions. | |