Case 037Systematic research and dataCore
Nivaan Homes, a listings platform, has 12,000 rental listings with size, location, age, floor and days on market. Design a model to predict monthly rent: which target, which features, how do you validate it, and which feature is a leakage trap?
1The situation
Nivaan Homes runs a rental listings platform in one large city. It wants to show landlords a suggested monthly rent when they list a flat. You are given 12,000 past listings, each with the flat's size in square feet, its locality, the building's age, the floor, the number of days the listing stayed live, and the rent at which it was let.
Rents run from about Rs 8,000 to over Rs 3 lakh a month. Many buildings have several listings in the data, some of them the same flat listed more than once.
2Your task
What do you predict, which features do you use, how do you check that the model works on flats it has not seen, and which feature would quietly make the model look better than it is?
Quick check
Which feature must be left out of the model?
Worked solution
Try it on paper, then open one step at a time.
30-second answerThe answer to give first
Predict the log of monthly rent from size, locality, age and floor, validate with folds grouped by building plus a final test on the most recent months, and leave days on market out. Log rent makes errors proportional, so a Rs 5,000 miss counts for more on a cheap flat than an expensive one. Days on market is recorded after the rent is set and rises when a flat is overpriced, so using it leaks the answer.
Step 1What should the model predict?
Predicting raw rupees lets the expensive flats dominate. A Rs 5,000 miss on a Rs 20,000 flat is 25% out; the same miss on a Rs 2 lakh flat is 2.5%. Predicting the logarithm of rent makes the model care about percentage errors, which is what a landlord feels, and it tames the long tail of very expensive flats. Size enters as log square feet for the same reason: rent roughly scales with size, so on the log scale the relationship is close to a straight line. One detail to state: turning a log prediction back into rupees gives something close to the median rent, not the mean, which is usually what a suggested rent should be anyway.
Step 2Which features belong in the model, and which one is a trap?
Think of an examiner who can see how long each student took before marking the paper: the time taken tells him something about the answer, but he cannot use it before the exam is written. The test for every feature is whether it exists at the moment the prediction is made; days on market fails, because it is recorded when the listing closes, after the rent is decided. It also carries the answer directly: a flat listed above the market rent sits unlet for longer. Including it is target leakageWhen a model is given information that would not be available at prediction time, often information caused by the thing being predicted, so it looks accurate in testing and fails in use.. Size, locality, age and floor are all known the day the flat is listed. Locality needs care: encode it using average rents computed only from the training folds, never from the whole data set, or the leak comes back by another door.
Step 3How do you check that the model works on flats it has not seen?
A random split of rows is the natural first idea and it flatters the model. The same building, and often the same flat, appears many times, so a random split puts near copies in both training and test, and the model is rewarded for remembering buildings rather than pricing flats. Group the folds by building so that each building sits entirely in training or entirely in test. Then hold back the most recent two months as a final test, because rents drift over time and the model will always be used on the next listing, never on a past one. Report the median absolute percentage error, which a landlord understands.
| Model | Validation | Median error |
|---|---|---|
| Locality median rent per sq ft x size | grouped by building | 17% |
| Regression on log rent, four features | grouped by building | 11% |
| Same model, random split | random rows | 9% |
| Same model plus days on market, random split | random rows | 6% |
Read the table from the bottom. The 6% model is the one a careless candidate reports, and it would fail the day it goes live because the feature does not exist yet. An honest 11% that holds up on new buildings is worth more than a 6% that cannot be run, and the interviewer is checking whether you can tell them apart. Say the limitation too: listings carry asking rents, and if the data recorded the rent actually agreed, that would be the better target.
Where candidates lose it
The common loss is throwing every column into the model and reporting the best score. Days on market will usually be one of the strongest predictors, which is exactly why it is dangerous: its strength comes from the answer leaking into it.
The second is validating with a random split. With repeated buildings, a random split tests memory, not prediction, and it overstates accuracy by an amount you cannot see unless you run the grouped version beside it.
What the interviewer asks next
- How would you use days on market legitimately, for example to predict whether a listing will let within a month?
- The model will be used in a new city with no data. What changes?
- How would you add photos or text descriptions of the flat?
- Why might a tree-based model beat a linear one here, and what would you check before trusting it?
Asked at Two Sigma, Quantitative Research, New York, 2025 (Wall Street Oasis): One is like model design- predict rent prices in Manhattan.
Company names and figures are illustrative.
