Inspiration

Buying an HDB resale flat is one of the biggest financial decisions many Singaporeans make, yet the information needed to make that decision is spread across different datasets and tools. Singapore publishes detailed resale transaction data, but a buyer still has to work out several questions separately: "Is this town getting more or less affordable? What might prices look like in six months? Can I actually afford the monthly repayment? Is this asking price reasonable compared with similar flats?"

The gap is real. HDB resale prices are up 56% since 2017 while median household income rose 33%. A median 4-room flat now costs 4.4 years of the median household's income, up from 3.8.

We built FlatFair to bring these questions into one decision journey.

What FlatFair does

FlatFair is a decision-support tool for HDB resale buyers covering five steps:

  1. Market intelligence - explore resale prices, transaction volume, price per square metre, momentum and historical trends by town and flat type. Towns are picked on a map of Singapore.
  2. Forecast - generate a six-month price outlook with an empirical 80% prediction range and backtested model performance.
  3. Affordability - estimate upfront cash, stamp duty, loan repayment and repayment-to-income against the 30% Mortgage Servicing Ratio cap, and see which towns fit a household's budget.
  4. Fair value - estimate what a flat should sell for today, show where the asking price sits against that range, explain what moves the estimate, and pin the five closest recent sales on a street map. Pick the block and FlatFair also shows what is within walking distance (MRT, buses, schools, shops and food, parks), and the estimate uses that block's location.
  5. Compare - put up to three towns side by side on price, growth, outlook, repayment share and the typical walk to a station.

Each step carries your choices to the next page, so it works as one journey instead of five separate tools.

How we built it

Data. We use official open data from HDB, LTA, MOE, NEA, NParks, URA and SingStat, plus OpenStreetMap for shopping malls and OneMap for the base map.

Databricks lakehouse. Raw data lands in Bronze Delta tables, is cleaned and validated in Silver, and becomes analytics-ready in Gold, all governed in Unity Catalog with table comments and tags. Spark SQL views give lineage and feed Databricks SQL.

Data quality. 241,920 resale rows go through nine validity checks. Problem rows are flagged with a named reason instead of being deleted.

Location. All 9,755 blocks with a resale record are placed using HDB's own building outlines, then measured against MRT exits, bus stops, schools, hawker centres, malls, parks and park connectors.

Models, tracked in MLflow.

  • Forecast: a rolling-origin backtest of four methods over 104 series and 3,702 forecasts. No random splits.
  • Fair value: three models compared, with a gradient boosting model using location features selected and registered in the Unity Catalog model registry.

App. A FastAPI and JavaScript app reads a small serving bundle published by the pipeline, so every page responds quickly without a warehouse query per request. It runs on Databricks Apps, with a public mirror on Vercel.

Challenges we ran into

  • Resale records have no coordinates. They only give a block and a street, and HDB's building outlines name streets by a code. We worked out which code each of the 580 streets uses and placed all 9,755 blocks. A spot check of 40 addresses against OneMap put them a median of 6 m apart.
  • Messy fields. Lease arrives in three text formats, and price and floor area arrive as text. We parse them into clean numbers, and fall back to the commencement year when a lease cannot be read.
  • No transaction ID. 318 exact duplicate rows could be real separate sales, so we flag them and keep them.
  • Our ML forecast lost to a simple baseline. The gradient boosting model learned 2020 to 2024 momentum and ran about 1.6% high when the market flattened. We published the 3-month average instead and show the full scorecard.
  • Free Edition limits. With a single small SQL warehouse, we publish a compact serving bundle and the app does not query a warehouse on every request.
  • Honest limits. The October 2024 flat classification change only applies to new BTO flats, so we show any before and after shift as an association, not a cause.

Accomplishments that we're proud of

  • The fair value model was tested on 13,588 sales it never saw. Median error was 3.0%, against 9.5% for the price per square metre rule of thumb, and 93.8% of estimates landed within 10% of the actual price.
  • Adding each block's location improved the typical error from 3.9% to 3.0%. We keep the model without location in the scorecard so that gain stays measured on every run.
  • We chose the forecast method by backtest, not by assumption, and we show buyers the range instead of a single number.
  • Nothing is silently dropped from the data. Every flag has a reason and every table has a source, so the numbers can be checked.
  • The app works from a 360 px phone to a 2560 px monitor, and we check every page at nine screen sizes in a real browser.

What we learned

  • A simple, well-tested baseline can beat a more complex model, and the right thing to do is report that honestly.
  • Location matters a lot in HDB prices, and the data needed to see it was already public, it just had to be joined carefully.
  • For a data set of about 240k rows, a tested Python package with Databricks handling storage, governance, MLflow and SQL was a better fit than forcing everything into Spark.
  • Buyers need a range and an explanation more than a precise number, so we put the uncertainty on screen next to every estimate.

What's next for FlatFair

  • Run the full pipeline as a Lakeflow Job in the final workspace.
  • Add a Genie space over the gold tables so buyers and planners can ask questions in plain English.
  • Bring in BTO supply context from the HDB Annual Report and planning-area population from SingStat.
  • Add grants, CPF usage limits and loan eligibility to the affordability step.
  • Test the journey with first-time buyers and housing counsellors.

Built With

Share this project:

Updates

Submission history