We followed one question as far as it would go: are homes getting harder to afford, and can a machine see it coming? Four weeks, one dataset about housing in 26 countries from 1977 to 2024, and a new method every week: cleaning, prediction, clustering and neural networks. This is the whole course in one story: what we built, what worked, and what didn’t.

Group 08 overview: every country-year from 1977 to 2024 as a dot, coloured by housing market mood

Four numbers sum up the course. 31 house prices hidden as zeros. 4 market moods found without labels. A neural network and a straight line that scored 3.22 and 3.28. And 1,953 parameters: all the network needed to tie with that straight line.

Key numbers: 31 hidden zeros, 4 market moods, 3.22 vs 3.28 average error, 1,953 network parameters

Week 1 · Data cleaning and exploration

The data looked perfect. It wasn’t.

We started with a Kaggle table: house prices and incomes for 26 countries over 51 years. No missing values, no duplicates, every country complete. Then we looked closer, and every problem we found became part of the story.

31 house prices were exactly zero; affordability lines for six countries, indexed to 2024

Affordability here means house prices divided by income: higher is harder to afford. Because every series is an index that reaches 100 in 2024, you compare how the lines move, not how high they sit. So we also compared each decade with each country’s own normal.

Heatmap of 26 countries by decade compared with their own normal, sorted by the 2020s; Spain at 87; Croatia’s 500% jump

Clean data, clear trends. Next question: could we see next year coming?

Week 2 · Supervised learning

The hardest rival was doing nothing.

We trained models to forecast next year’s affordability from what is known this year. Before any model, we wrote down the laziest forecast possible: next year will be the same as this year. Prices move slowly, so that guess is already close. It became the bar almost nothing could clear.

Time split: learn from 1977–2014, test on 2015–2024; Ridge lands within 5% for 83% of forecasts

Splitting by time mattered. Neighbouring years of a country are almost identical, so a random shuffle lets a model peek at its own future: it looked 13% better than it really was.

Cross-validation error for seven models against the persistence baseline; the classifier flags 84% of worsening years

A forecast is one number. We wanted a vocabulary for what a market is going through.

Week 3 · Unsupervised learning

Housing markets have moods.

This time nobody told the computer what to look for. For every country-year we gave it four measures: price growth, income growth, momentum, and how expensive the market is compared with its own history. K-Means found four groups, and every one of them could be named.

PCA map of 1,210 country-years coloured by regime, and regime shares per decade
The four regimes: affordable steady growth 30%, price boom 18%, expensive plateau 35%, price correction 17%

The moods are not just labels, they tell you what comes next. After a boom year, affordability gets worse again 80% of the time. After a correction year, it keeps improving 85% of the time. And the same sequence repeats across countries and decades.

Regime timelines for Spain, Ireland, the United States, Finland, Sweden and Japan

Then the question every AI course asks: would a neural network do better?

Week 4 · Neural networks

We built a small brain. It tied with a straight line.

We gave the week 2 forecast to a neural network: same data, same inputs, same test years. A multi-layer perceptron with 26 inputs, two hidden layers of 32 neurons and one output. 1,953 parameters, trained in about 30 seconds on a laptop.

Network diagram 26-32-32-1 following Spain 2012, and the tuning experiments

One decision mattered more than all the tuning: predicting the change instead of the level. The rest made no measurable difference. On the test years, the network and Ridge ended in a draw, and both missed the same year.

Average test error: persistence 3.74, Ridge 3.28, neural network 3.22; error per forecast year peaks for 2023

Splitting the errors by the week 3 moods closes the loop between the weeks: booms are the hardest to read for every model. And a what-if for Spain shows how both models react when prices rise faster.

Error by market regime, and a what-if for Spanish prices in 2024

Four weeks, one dataset, one question. After the course, a separate one-week hackathon asked us to put these skills into practice on something completely new: an app that turns photos of Barcelona into music. It uses its own data and its own model, so it has its own post: Chroma: Hear the Place You Are In.

Lessons — what one term taught us

Four things we’ll keep.

Four weeks, four methods, one dataset. These are the lessons we will carry into whatever we build next.

Four lessons: the data decides; beat the lazy guess first; simple wins when the world is smooth; say what you don’t know

Group 08: Akshat Dayal, Bhavini Manot, Bo De Roeck · Master in AI for Architecture and the Built Environment 2026–27 · AI Methods I

Code and models: GitHub repository, weeks 1–4 · Hugging Face collection

Housing data: Kaggle, likely based on the Dallas Fed International House Price Database, CC BY-SA 4.0. Affordability values are indexes: compare movements over time, not levels between countries.