Madrid Rental ML Dashboard
One live app that takes about 2,085 Madrid rental listings and runs the full machine learning story: exploring the market, clustering into segments, predicting rent, and classifying high-rent homes. Everything trains live when the app starts.
Madrid, in numbers.
The dataset is about 2,085 rental listings scraped from Idealista. The median asking rent is €1,400 a month, the average home is 129 m², and that works out to €16.51 per square meter.
Five segments of the market.
A K-Means model groups the listings into five segments. Most homes fall into Standard Exterior Living, while a small Grand Estate segment carries by far the highest rents.
Share of listings per segment
Donut chart, share of listings per segment: Standard Exterior Living 58%, Entry-Level Interior 12%, High-Rise Exterior 11.4%, Urban Premium 10.7%, Grand Estate 7.8%.
Median rent by segment
Horizontal bar chart, median rent by segment: Grand Estate €4,500, Urban Premium €2,100, High-Rise Exterior €1,600, Standard Exterior €1,300, Entry-Level Interior €1,075.
Predicting rent.
An OLS regression with VIF filtering and RFECV feature selection estimates monthly rent. On the held-out test set it explains 78% of the variance, misses a typical listing by €469, and carries an RMSE of €733, which weights the large misses more heavily. Durbin-Watson sits at 2.05, so the residuals are not autocorrelated.
Feature effects on rent
Feature effects on predicted rent, ordered by size of effect. Central location raises rent the most, then size in square meters, then floor level. Being a special listing lowers rent, and being a studio lowers it the most.
Spotting high-rent homes.
A logistic regression flags whether a listing is high-rent, with an adjustable probability threshold. It reaches 87% accuracy and a test AUC of 0.94, with almost no gap between train and test.
ROC curve · AUC 0.94
True positive rate against false positive rate. Dashed line is a coin toss.
ROC curve for the high-rent classifier: area under the curve 0.94, well above the random-classifier diagonal, at 87% accuracy on the test set.
One app, the whole pipeline.
The app covers exploratory analysis, five K-Means segments, Apriori association rules, the OLS rent predictor with a 95% prediction interval, and the logistic high-rent classifier with a ROC curve and odds ratios. I wanted anyone to be able to read the market and test a property in a few clicks, not just look at a finished chart.