Team course project (2 people)

Bordeaux Airbnb price prediction

Université de Technologie de Compiègne · BA08 Data Science for the Smart City (spring 2024)

An end-to-end study of 11,854 Bordeaux listings from Inside Airbnb: EDA, maps and ANOVA, five features mined from the listing title, and a 100 € price split comparing linear regression, random forest, Ridge and Lasso. Random forest reaches a test R² of 0.52 (low price) and 0.55 (high price).

Background

This was the BA08 “Data Science for the Smart City” course project at UTC, submitted in June 2024. The assignment allowed either a smart-city use case built from scratch (Level 1) or replaying and improving a public case (Level 2). We chose Level 2, using the Kaggle notebook NYC Airbnb: EDA, Visualization, Regression as a baseline, then adding three improvements: a new city and original data source, features mined from the title, and price-segmented modelling.

Data

  • Source: the Inside Airbnb Bordeaux snapshot, data/listings.csv, 11,854 rows × 18 columns, latin-1 encoded;
  • Target: nightly price (€); 8,162 non-missing values, median €82, mean €115, max €5,300;
  • Only the five largest districts are kept (Bordeaux, Mérignac, Talence, Pessac, Bègles): 9,033 listings, about 76%;
  • Samples used for modelling after cleaning: 2,630 low-price (< €100) and 1,629 high-price (> €100) listings, 4,259 in total.

host_name is dropped not only because it carries no signal for price, but also for ethical reasons: no inference should be made about real individuals.

Features and cleaning

The name column looks like Rental unit in Bordeaux · ★New · 2 bedrooms · 1 bath. Five new columns are extracted with regular expressions:

  • note: guest rating, with New mapped to −1;
  • number_of_bedrooms / number_of_beds / number_of_baths: Studio counts as one bedroom and Half-bath as 0.5 bath;
  • type_of_baths: private or shared.

Cleaning: missing reviews_per_month becomes 0; rows missing price, note or the three capacity features are dropped; prices and counts are heavily right-skewed, so they are log10-transformed, including the target.

The EDA covers histograms and boxplots, Folium maps coloured by district and room type, a correlation heatmap, and a one-way ANOVA with pairwise comparisons testing whether the district significantly affects price (low-price segment, p ≪ 0.05).

Modelling

Two preprocessing pipelines, each trained on both price segments with four models:

Model 1Model 2
Numeric featureslog10 transformquantile qcut bins (2–3 levels)
Categorical featuresone-hot (drop_first=True)one-hot (drop_first=True)
Feature count8857
Modelslinear regression, random forest (max_depth=8, 100 trees), Ridge, Lassosame
TuningGridSearchCV over alphasame
ValidationKFold (8/10) + 70/30 splitsame

Metrics are computed in log10(price) space: RMSE = 0.09 corresponds to roughly 10^0.09 − 1 ≈ 23% relative error.

Results

  • Random forest with Model 1 wins on both segments: test R² = 0.52 for low price and 0.55 for high price;
  • linear models plateau around 0.4 (0.41 and 0.46), pointing to non-linear relationships and many unobserved drivers (decoration, view, seasonality, events);
  • the binned pipeline (Model 2) is consistently worse for every model — turning continuous variables into categories throws information away;
  • the three capacity features mined from the title are essential: without them, some models fall below R² = 0.1;
  • random forest overfits: R² = 0.68 on the low-price training set versus 0.52 on the test set.

Limitations

The sample is small (4,259 listings, only 1,629 in the high-price segment), the data is a single snapshot with no seasonality, features such as surface, renovation, view and transport are missing, the regex extraction fails on non-standard titles, and metrics live in log10 space. Natural next steps are SHAP explanations, XGBoost/LightGBM and a wider hyper-parameter search.

Source, notebook, report, defence slides and DataCamp certificates: https://github.com/yicongl1/Bordeaux-Airbnb

Technical notes

01 Mining features from listing titles: regex, missing values and signal Bedrooms, beds, baths and rating hidden in the name column, the Studio and Half-bath edge cases, and what happens when those features disappear. 02 Price-segmented modelling: four models, two pipelines and log10 metrics The 100 € split, 88 versus 57 features, why random forest wins, and how to read RMSE in log10 space.

Course certificates

Introduction to Python · 4 h · 13 Mar 2024 · ID 32,952,285
Introduction to Python · 4 h · 13 Mar 2024 · ID 32,952,285
Intermediate Python · 4 h · 18 Mar 2024 · ID 33,304,822
Intermediate Python · 4 h · 18 Mar 2024 · ID 33,304,822
Data Manipulation with pandas · 4 h · 24 Mar 2024 · ID 33,370,844
Data Manipulation with pandas · 4 h · 24 Mar 2024 · ID 33,370,844
Cleaning Data in Python · 4 h · 1 Apr 2024 · ID 33,528,954
Cleaning Data in Python · 4 h · 1 Apr 2024 · ID 33,528,954
Exploratory Data Analysis in Python · 4 h · 7 Apr 2024 · ID 33,628,107
Exploratory Data Analysis in Python · 4 h · 7 Apr 2024 · ID 33,628,107
Supervised Learning with scikit-learn · 4 h · 13 Apr 2024 · ID 33,707,517
Supervised Learning with scikit-learn · 4 h · 13 Apr 2024 · ID 33,707,517
Unsupervised Learning in Python · 4 h · 6 May 2024 · ID 34,012,519
Unsupervised Learning in Python · 4 h · 6 May 2024 · ID 34,012,519

Related skills

  • Python
  • Git