Lesson 11.2 · 8 min read · about 50 min to master at a very slow pace

Designing a Network for Tabular Data

A worked design for a regression problem: predicting house prices from features such as size, bedrooms and location. Architecture, activations, loss, regularisation, categorical features and the challenges to expect.

Not startedJump to quiz

The task

Predict a house's price (a number) from features: floor area, number of bedrooms, location, property type, and so on. This is regression on tabular data.

A sensible starting design

ChoiceProposalWhy
Layers2–3 fully connected hidden layers, e.g. 64 → 32 → 16 unitsTabular features have no spatial structure, so dense layers suit; shrinking widths compress the features
Hidden activationReLUNon-linear, cheap, avoids vanishing gradients
Output1 unit, linearA price is any positive real number; a sigmoid would cap it
LossMSE (MAE if outliers matter)Standard for regression; MAE resists extreme prices
RegularisationL2 weight decay; optionally dropout; early stoppingTabular datasets are often small, so overfitting is the main risk

It's a starting point, not a recipe: the best architecture depends on the data and is chosen on validation performance.

Preparing the features

  • Numeric features: standardise using training statistics (also the target, then undo it on the predictions).
  • Categorical features (location, property type): one-hot encode. With many categories (hundreds of postcodes), use an embedding layer that learns a short dense vector per category.
  • Missing values: impute with training medians and add "was missing" indicators.
  • Outliers: cap or remove clear errors; consider a log of the price as the target.

Challenges to expect

  • Overfitting on a small dataset: regularise, use cross-validation, collect more data.
  • Mixed feature types and scales: encode and scale consistently.
  • Irrelevant features: L1 or simply checking which features matter.
  • Leakage: a feature known only after the sale (such as the final agent fee) must be excluded.

Stuck? Common doubts

Questions real learners asked while studying this lesson. They stay closed so they don't spoil your own thinking: open only the ones you need.

First passWhy not encode location as a number, like 1 = north, 2 = south?

Because the network would treat it as a quantity: "south" would be "twice north", and locations 1 and 3 would look further apart than 1 and 2. One-hot encoding gives each location its own input with no false ordering; embeddings go further and learn which locations behave similarly.

Cheatsheet

Tabular regression design

Dense ReLU layers (64→32→16), 1 linear output, MSE, L2 + early stopping (+ dropout). Standardise numerics, one-hot or embed categories.

See every cheatsheet by category →

Check your understanding

Score 75% or more to master this lesson and earn XP. Answer first, then check.

Q1applyFor predicting house prices, which output layer and loss should you start with?
Q2applyA "postcode" feature has 2,000 distinct values. What's the best way to feed it in?
Q3conceptWhy might you train on the logarithm of the price instead of the price itself?
Q4applyYou have only 800 houses. Which combination best reduces the risk of overfitting?
Q5interpretOne feature is "final agent fee", known only after the sale completes. Should it be an input?