Day 2 · Tuesday · Empirical studio

Predicting a quoted London price

Read before opening the notebook60 minutes; pair work with individual votes
Dataset
Inside Airbnb London listings

Pinned snapshot; prediction exercise, not pricing advice

ItemCourse definition
Fileslondon_price_development.csv; london_price_validation.csv; london_price_deployment_features.csv; day2_application.ipynb
Unitone eligible London listing with a valid one- to seven-night quote
Population and period54,636 eligible listings from 27,278 hosts in the Inside Airbnb London snapshot of 19 June 2026
Targetprice_gbp, the quoted nightly price in pounds; not a transaction price, booking, occupancy, revenue, future price, or optimal price
Variablesnumeric: accommodates, bedrooms, beds, minimum_nights; categorical: room_type, neighbourhood_cleansed; host_id is split-only
Prediction pointsame-snapshot cross-sectional prediction before the target is supplied to the fitted model; this is not a future-time forecast
Splitsdevelopment: 32,749 listings/16,381 hosts; validation: 11,063/5,461; final holdout: 10,824/5,436; no host crosses splits
SourceInside Airbnb, London detailed listings.csv.gz, 19 June 2026
Where useddevelopment fits preprocessing and models; validation compares predeclared candidates; the final holdout evaluates the recorded specification once

Gate 1: answer before code

  1. The claim matched by the split

    What does the final host-disjoint holdout examine most directly?

    1. Prediction for another listing from a host used in fitting

    2. Prediction for eligible listings from unseen hosts in the same snapshot

    3. Prediction in next year's London market

    4. The causal effect of increasing a listing's price

  2. What the target does not measure

    Which question cannot be answered by price_gbp alone?

    1. What quoted nightly price appears in the pinned listing snapshot?

    2. How close is a model prediction to that quoted price?

    3. How does quoted price vary with represented listing characteristics?

    4. What price would maximise the host's profit if the host changed it?

  3. Preprocessing belongs inside the fitting boundary

    Where should missing-value replacements and category definitions be learned when validation is used to compare models?

    1. Development rows only

    2. Development and validation combined before comparison

    3. Validation rows only

    4. The final holdout, because it is largest

What you will do in the notebook

  1. Confirm row counts, target meaning, variables, and zero host overlap.

  2. Calculate the development mean and median. Use the mean baseline for RMSE and the median baseline for MAE.

  3. Fit a simple linear model using accommodates; interpret its slope as a predictive association in this snapshot.

  4. Fit the compact linear model. Learn every imputer and category level from development rows only.

  5. Compare the four predeclared candidates on all validation listings. Inspect impossible negative predictions without adding a new rule.

  6. Record one specification. Only then open the final aggregate results.

Gate 2: validation revealAfter all four validation predictions are savedMetrics use all 11,063 validation listings.
ModelMAERMSEPredictive \(R^2\)Negative predictions
Mean baseline128.999170.7260.0000
Median baseline120.744174.946-0.0500
Simple linear model96.015137.2660.3540
Compact linear model75.483114.6280.5497
  1. Selecting under squared-error concern

    If the predeclared primary metric is RMSE, which model has the strongest validation result?

    1. Mean baseline

    2. Median baseline

    3. Simple linear model

    4. Compact linear model

  2. What the negative predictions reveal

    How should the seven negative quoted-price predictions affect the conclusion?

    1. Ignore them because average RMSE improved

    2. Treat them as an impossible-output failure that must be addressed and evaluated on fresh evidence before deployment

    3. Clip them to zero after seeing validation and claim the same validation as final evidence

    4. Conclude that every compact-model prediction is wrong

  3. Reading the simple slope

    The simple fitted slope is about £46.97 per accommodated guest. Which interpretation is appropriate?

    1. Increasing any listing's capacity by one causes its price to rise by £46.97

    2. In this fitted snapshot model, listings differing by one recorded guest have fitted prices differing by about £46.97

    3. Every observed listing charges exactly £46.97 per guest

    4. The slope estimates additional host profit

Gate 3: final holdout revealAfter the specification is recordedMetrics use all 10,824 listings from unseen hosts.
ModelMAERMSEPredictive \(R^2\)
Refitted mean baseline127.392172.4830.000
Simple linear model96.921138.9330.351
Compact linear model77.882117.0290.540

The compact model produces 15 negative predictions.

  1. The narrow empirical result

    Which statement is supported?

    1. The compact model reduces RMSE relative to the refitted mean for unseen hosts in this snapshot, while impossible outputs remain

    2. The compact model predicts next year's market with RMSE £117.029

    3. The compact model identifies the profit-maximising price

    4. The compact model proves that its variables cause quoted prices

  2. Evidence needed for pricing advice

    What would be required before recommending a price change to a host?

    1. Only a lower same-snapshot RMSE

    2. Transaction, occupancy, demand, revenue, and cost outcomes plus a credible design for the effect of changing price

    3. The largest coefficient in the compact model

    4. Replacing every negative prediction with zero

← Day 2 lecture  ·  All four days →

Oxford · United Kingdom Course home Teaching CV
University of Oxford