Team course project (2 people)
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).
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/listings.csv, 11,854 rows × 18 columns, latin-1 encoded;price (€); 8,162 non-missing values, median €82, mean €115, max €5,300;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.
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).
Two preprocessing pipelines, each trained on both price segments with four models:
| Model 1 | Model 2 | |
|---|---|---|
| Numeric features | log10 transform | quantile qcut bins (2–3 levels) |
| Categorical features | one-hot (drop_first=True) | one-hot (drop_first=True) |
| Feature count | 88 | 57 |
| Models | linear regression, random forest (max_depth=8, 100 trees), Ridge, Lasso | same |
| Tuning | GridSearchCV over alpha | same |
| Validation | KFold (8/10) + 70/30 split | same |
Metrics are computed in log10(price) space: RMSE = 0.09 corresponds to roughly 10^0.09 − 1 ≈ 23% relative error.
R² = 0.52 for low price and 0.55 for high price;R² = 0.1;R² = 0.68 on the low-price training set versus 0.52 on the test set.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






