A newer version of the Gradio SDK is available: 6.20.0
metadata
title: Zurich Apartment Rent Assistant
emoji: 🏠
colorFrom: blue
colorTo: green
sdk: gradio
sdk_version: 5.9.1
app_file: app.py
pinned: false
Zurich Apartment Rent Assistant
A conversational AI agent that estimates monthly rental prices for apartments in Zurich, Switzerland. Describe an apartment in plain language — the agent extracts the relevant parameters and runs a machine-learning prediction.
How it works
- You describe an apartment in natural language (rooms, size, location, features)
- GPT-4o-mini extracts structured parameters and outputs them as JSON
- A Gradient Boosting regression model (trained on ~800 Zurich listings) predicts the monthly rent
- GPT-4o-mini translates the prediction back into a friendly, contextualised explanation
Example inputs
- "I'm looking for a 3-room apartment, about 80 m², in Kreis 3."
- "What would a furnished 1.5-room apartment in Zurich city, roughly 40 m², cost?"
- "I want a 4.5-room penthouse with lake view in Kreis 8, about 150 m². It's luxurious."
Parameters the model uses
| Parameter | Description |
|---|---|
| rooms | Number of rooms (half-rooms supported, e.g. 3.5) |
| area | Living area in m² |
| tax_income | Municipal median tax income (proxy for neighbourhood wealth) |
| luxurious / furnished / temporary | Apartment type flags |
| zurich_city | True = within city of Zurich, False = greater canton |
| attika / loft / seesicht | Special features |
| kreis | Zurich city district (Kreis 1–12) |
Setup
The app requires an OPENAI_API_KEY environment variable (set as a Hugging Face Space secret).
Model
- Algorithm: Gradient Boosting Regressor (scikit-learn)
- Training data: ~800 Canton Zurich apartment listings
- Key features: Income-Density Score (tax income × population density), log-transformed area, district dummies
- CV R²: ~0.70