← All projects
SIT307 Machine Learning · Deakin

Sydney Housing Price

A quick second opinion for real estate agents: type in a property's details and get an estimated sale price in seconds.

scikit-learn Random forest Streamlit pandas
The Sydney Housing Price Estimator app showing an estimated price
101
sold properties I collected by hand
3
suburbs, from entry level to prestige
~12%
typical error on a normal home
01

The question

Can one model price homes across three very different Sydney markets?

  • Mount Druitt: entry level, first-home buyers and investors
  • Cabramatta: mid range, families and investors
  • Vaucluse: harbour-side prestige

The same house can be worth very different amounts depending on where it is, so the model has to learn that.

02

The data

I opened 101 sold listings on realestate.com.au and domain.com.au and typed each one into a spreadsheet, including the agent's description.

  • Year built (98%) and building size (83%) were almost never listed, so I left them out.
  • I turned agent descriptions into keyword features, like harbour views, luxury words and "investor" language.
  • Suburb and property type had to be read together. Cabramatta's median looks low only because most of its sales were units.
Box plot of sale price by suburb for houses and strata, and a scatter of bedrooms against price
A typical Vaucluse house sold for about 7 times a typical Mount Druitt house.
03

What I did

Prices were very skewed, so I predicted log(price). Then I compared three model families with cross-validation.

ModelTest RMSE (log)Average errorMedian error
Ridge regression0.33725.2%15.4%
Random forest0.30319.0%12.2%
Gradient boosting0.30619.7%12.6%

I chose the random forest. It had the lowest error and it fails safely. Ridge guessed $18.7M for four apartments that sold together for $6.45M. The forest can't go that far off.

04

What I found

  • Ordinary homes are easy. Median error was about 8% in Mount Druitt.
  • Prestige homes are hard. Median error for Vaucluse houses was 38%.
  • The biggest miss was a $22.41M harbour-view home, predicted at $8.04M. Its value came from views of the Opera House and Bridge, which my features couldn't capture.
Actual vs predicted price for the random forest, with the five largest errors circled
The five largest errors (circled) are almost all top-end Vaucluse homes.
05

The app

I built the app in Streamlit and hosted it on Streamlit Community Cloud. It shows the estimate along with a clear warning that prestige homes and development sites are harder to predict.

App input form with suburb, property type, rooms and features
Enter the property details
App showing the estimated sale price
Get an estimated sale price
06

What I learned

  • Understanding the data mattered more than the model. All three models ended up within about 0.03 log RMSE of each other.
  • One number can hide a lot. Ridge looked fine on log error but was the worst in dollars.
  • The worst predictions taught me the most, including a data-entry mistake of my own.