End-to-End ML for German Real Estate Prediction — live demo

A scientific notebook turned into a deployable web service. Two scikit-learn pipelines: Gradient Boosting (elevator presence) + XGBoost (monthly base rent in EUR), trained on ~202k cleaned rows from a Kaggle German rentals dataset.

← Home LinkedIn Notebook View on GitHub
About this project

This project started as my first ML notebook — a research artifact comparing 10 different models for two prediction tasks on the German Apartment Rental Offers Kaggle dataset (268k rows). The notebook used MLflow to track experiments and identified Gradient Boosting as the best elevator-presence classifier and XGBoost as the best base-rent regressor.

I then refactored the notebook into a production-shaped commercial version: two serializable sklearn.pipeline.Pipeline objects, a FastAPI backend, this static HTML form, and a 100-record holdout dataset preserved for live predicted-vs-actual demos (use the dropdown below).

After a code review I iterated to v2: added geographic features (state + city, the latter via TargetEncoder to dodge dimensionality blowup), removed PCA from the regression pipeline (it was destroying signal in tree models), log-transformed the rent target via TransformedTargetRegressor, and applied class-balanced sample weights to the elevator classifier.

BaseRent R²:0.886 BaseRent MAE:€88.73 Lift class-1 recall:0.62 Lift macro F1:0.70 Training rows:161,664 Holdout rows:100

Try the geographic intuition: in the BaseRent form below, set an apartment with realistic features and change only the city. Munich predicts ~€1,286/month for an 80 m² apartment; the same apartment in Magdeburg predicts ~€521. The model learned this entirely from data.

Tech stack: scikit-learn 1.6 · XGBoost 3 · FastAPI · pydantic v2 · joblib · vanilla HTML/JS (no framework). Full documentation, training scripts, and the original research notebook are in the GitHub repository — see README.md, PROJECT_EVOLUTION.md, and MODEL_IMPROVEMENTS.md.

Has elevator? (Lift classifier)

Gradient Boosting · test acc
Training report

Predicted base rent (EUR/month)

XGBoost · test R² · MAE €
Training report
Empty fields are sent as null and imputed by the pipeline (median for numerics).