Source-linked AI summary

Predicting Residential Rents in Dakar Using Machine Learning

Amadou Tidiane Kassa Diallo

arXiv:2608.30865v1cs.AI

TL;DR

Dakar’s residential rental market is economically important but poorly documented, especially because available information mainly concerns asking prices. The study builds and interprets a machine-learning pipeline for Dakar rental listings, and optimized XGBoost achieves the strongest reported performance while location rankings differ between gain and SHAP analyses. The paper also identifies data coverage, asking-price, geographic, and interval-calibration limitations.

  • Problem

    Dakar’s residential rental market remains poorly documented, with fragmented asking-price information and no identified systematic study combining prediction, optimization, SHAP interpretation, and uncertainty quantification.

  • Method

    The study constructs a cleaned corpus from online rental listings and compares optimized machine-learning models with complementary feature-importance and uncertainty-quantification methods.

  • Results

    R2 of 0.847, MAE of 210,902 FCFA, and RMSE of 324,195 FCFA are achieved by the optimized XGBoost model on the single split.

  • Takeaways & Limitations

    SHAP identifies location as one of Dakar’s main rent determinants and reveals importance differences from XGBoost gain, supporting combined interpretability methods.

  • Takeaways & Limitations

    The study is limited by online asking prices, absent precise geographic coordinates, uneven geographic coverage, and prediction intervals requiring recalibration.

Abstract

from arXiv · show

Dakar's residential rental market remains poorly documented despite its economic and social importance: 54.4% of households are renters, compared to 23.3% nationally. This study develops a complete machine learning pipeline to predict residential rents in Dakar, from data collection to model interpretation. An original dataset of 1,507 rental listings was built through systematic web scraping and a documented cleaning pipeline, then enriched with four purpose-built features, including a luxury score and a keyword-based quality score. Five models were compared: linear regression, Random Forest (baseline), XGBoost, and LightGBM optimized through Bayesian optimization with Optuna, using leakage-free KFold target encoding for location. The optimized XGBoost model achieved the best performance with an $R^2$ of 0.847, an MAE of 210,902 XOF, and an RMSE of 324,195 XOF. Feature importance was assessed using native XGBoost gain and SHAP values, revealing a substantial difference in the ranking of location, which appears as a minor predictor by gain but as the second most influential variable by SHAP. This result carries methodological implications for hedonic studies using target-encoded categorical variables. This study provides an interpretable benchmark for Dakar's rental market and highlights several avenues for improvement, including the integration of geospatial features and conformal prediction.

1. Introduction

Dakar’s rental market is economically important but quantitatively under-documented, motivating an interpretable machine-learning pipeline for rent prediction and uncertainty assessment.

  • 54.4% of households in Dakar are renters, compared to 23.3% nationwide.
  • Dakar’s rental market relies largely on fragmented asking-price information, while negotiated prices and completed transactions are difficult to access.
  • Hedonic pricing theory models rents through property characteristics such as surface area, location, bedrooms, and amenities.
  • Prior African real-estate research is fragmented across hedonic and machine-learning studies, including work in Lagos, Kampala, and Greater Banjul.
  • No identified study combines rent prediction, model optimization, SHAP interpretability, and uncertainty quantification for Dakar listings.
  • The study constructs an original 1,507-listing dataset and combines data preparation, optimized modeling, feature-importance analysis, and predictive-uncertainty assessment.

2. Literature Review

The literature review situates the study among linear and tree-based approaches, emphasizing nonlinear prediction and complementary interpretability methods for rental data.

  • Linear regression: Linear regression provides a benchmark under a linear relationship assumption and measures gains from nonlinear models.
  • Random Forest: Random Forest aggregates predictions from many randomized bootstrap-trained decision trees to reduce variance and limit overfitting.
  • XGBoost: XGBoost sequentially builds trees that correct prior residual errors using gradient descent on a regularized loss function.
  • LightGBM: LightGBM improves computational efficiency through leaf-wise tree growth, histogram-based numerical discretization, and native categorical handling.
  • Interpretability: The study uses gain-based importance and SHAP values as complementary approaches for interpreting tree-based models.
  • Interpretability: Gain importance measures average loss reduction from variable-involving splits, favoring variables involved in fewer but highly decisive splits.

3. Materials and Methods

The study builds a cleaned and enriched dataset of Dakar rental listings, then evaluates optimized machine-learning models through leakage-aware preprocessing, validation, interpretation, and uncertainty estimation.

  • Data collection and preparation: Data were scraped from online real-estate platforms between January 2024 and June 2025, focusing on residential rentals in Dakar.
  • Feature engineering: Four derived variables captured luxury attributes, nonlinear bedroom effects, bathroom-to-bedroom comfort, and keyword-based premium positioning.The luxury score uses seven amenities, while the keyword score weights 18 premium-related terms.
  • Data collection and preparation: 1,507 listings and 33 variables remained after preprocessing and feature engineering.The corpus covers 24 localities in Dakar.
  • Preprocessing and encoding: Location was processed with KFold target encoding using training observations only to reduce leakage risk.For unseen test localities, the overall training-set median was used.
  • Modeling and optimization: Five approaches were compared, including linear regression, Random Forest, baseline XGBoost, and optimized XGBoost and LightGBM.Optimization used Bayesian search with Optuna's Tree-structured Parzen Estimator.
  • Evaluation and interpretation: Evaluation used MAE, RMSE, and R^2 after inverse transformation to the original FCFA price scale, with an 80%/20% split and 5-fold cross-validation.The optimized XGBoost model was interpreted using native gain importance and SHAP values, while quantile models estimated predictive intervals.

4. Results and Analysis

The dataset is concentrated in several Dakar neighborhoods and contains strongly right-skewed rents. Correlation analysis highlights bedrooms, surface area, and luxury as important numerical relationships, while nonlinear models are needed for the broader variation.

  • Dataset overview: The final dataset contains 1,507 listings across 24 localities, with a median monthly rent of 700,000 FCFA.The mean rent is 950,411 FCFA, and median living area and bedroom count are 189 m2 and 3.
  • Dataset overview: 55.6% of listings come from Almadies, Ouakam, Mermoz, Point E, and Fann.This concentration must be considered when interpreting performance by neighborhood.
  • Price distribution: Rent is strongly right-skewed, with skewness 1.55 and a long tail of upscale properties exceeding 2,000,000 FCFA monthly.The majority of listings fall between 300,000 and 1,300,000 FCFA per month.
  • Price distribution: The log(1 + price) transformation reduces dispersion among high rents and produces a more balanced distribution.
  • Correlations and spatial structure: The strongest numerical correlations with price concern bedrooms, surface area, and luxury_score.These individual relationships do not fully explain rent variation, motivating models that capture nonlinearities and interactions.

4.4 Comparative Model Evaluation

The optimized XGBoost model achieved the strongest test-set performance, while cross-validation confirmed strong results but exposed lower performance than the single split on the original price scale. The findings support nonlinear machine-learning models while cautioning against relying on one split alone.

  • The optimized XGBoost model achieves the best test-set performance, with an R2 of 0.847, closely followed by optimized LightGBM at 0.842.
  • A 16.8 R2-point gap between linear regression at 0.679 and XGBoost highlights the importance of nonlinear relationships in Dakar rent prediction.
  • Optimized XGBoost and LightGBM produce tighter actual-versus-predicted clusters than linear regression, although residual dispersion remains for properties above 2,000,000 FCFA.
  • The optimized XGBoost and LightGBM models achieve the best 5-fold cross-validation results, with a mean R2 of approximately 0.852 on the logarithmic scale.
  • On the original price scale, optimized XGBoost reaches a mean R2 of 0.782 and a mean RMSE of 369,744 FCFA, compared with 0.847 and 324,195 FCFA on the single split.
  • The single split should be interpreted cautiously and complemented by cross-validation to assess model robustness and stability.

4.7 Feature Importance According to XGBoost Gain

XGBoost gain-based importance identifies luxury_score, bedroom-related variables, sea view, and quality-related features as major contributors, while amenities collectively provide substantial gain. Correlation among amenities requires cautious interpretation.

  • luxury_score contributes 23.7% of total gain, followed by nbre_chambre at 14.4% and nbre_chambre_sq at 12.3%.
  • vue_mer contributes 7.7% of total gain, kw_score 7.3%, location_encoded 3.4%, and parking 2.9%.
  • The 23 binary amenity variables collectively account for 28% of total gain.Some amenities may be correlated or provide similar information to the model.
  • The gain-based analysis is complemented by SHAP values to better assess variables’ influence on predictions.

4.8 Interpretability via SHAP Values

SHAP analysis measures feature contributions to individual predictions and produces a ranking that differs materially from native XGBoost gain. In particular, location ranks second by mean absolute SHAP value, supporting its importance in Dakar rent determination.

  • SHAP values were computed on the test set to analyze each variable’s influence on model predictions.
  • The model’s base value is 13.44 in log price, approximately 686,870 FCFA after conversion to the price scale.
  • The six leading features by mean absolute SHAP value are luxury_score at 0.163, location_encoded at 0.155, kw_score at 0.132, surface at 0.107, nbre_chambre at 0.075, and vue_mer at 0.072.
  • For the top six features, feature values and SHAP impacts have a monotonically increasing relationship, with Pearson correlations exceeding 0.90.The reported features are location_encoded, luxury_score, kw_score, surface, nbre_chambre, and vue_mer.
  • location_encoded ranks sixth by XGBoost gain at 3.4% but second by mean absolute SHAP value, behind luxury_score.
  • The ranking difference reflects the measures’ calculation principles rather than model instability: gain averages split-level loss reductions, whereas SHAP aggregates contributions across individual predictions.
  • SHAP identifies location as a main determinant of Dakar rents and is methodologically relevant as a complement to gain for target-encoded location variables.
  • SHAP’s local additivity decomposes an individual prediction into the model base value plus each variable’s contribution.

4.9 Prediction Intervals via Quantile Regression

Quantile regression complements point predictions with prediction intervals intended to represent rent uncertainty. The resulting intervals are substantially undercovered and too narrow relative to observed rent variability.

  • Three XGBoost quantile models, q10, q50, and q90, were trained using the optimized hyperparameters and the reg:quantileerror objective.
  • The q10–q90 interval targets nominal coverage of 80%, while q50 represents the median rent estimate.
  • Quantile regression complements point predictions with an uncertainty estimate and assesses rent dispersion around predicted values.
  • 64.2% empirical coverage falls below the targeted nominal coverage of 80%, and the median interval width is 376,376 FCFA.
  • The intervals are not properly calibrated because q10 is often too high and q90 too low, making them too narrow relative to actual rent variability.

5. Discussion

The optimized XGBoost model captures a substantial share of Dakar rent variation, while interpretation and data limitations constrain broader conclusions. SHAP elevates location’s influence relative to gain-based importance, and quantile intervals remain undercovered.

  • Predictive performance: R^2 0.847 shows that optimized XGBoost captures significant information about rent variation in Dakar.Its performance remains close to results in other real estate contexts, though slightly below some benchmarks.
  • Interpretability: Location_encoded ranks relatively low by XGBoost gain but among the most influential variables by SHAP.SHAP measures contributions to individual predictions and aggregates them across observations.
  • Interpretability: Combining XGBoost gain and SHAP values reduces reliance on a single importance measure in hedonic studies using ensemble models and target encoding.The two measures can substantially change the relative importance attributed to location and property characteristics.
  • Corpus limitations: Online listings likely overrepresent upscale properties, leaving informal or unpublished rental-market segments absent from the corpus.The observed distribution therefore cannot be directly generalized to the entire Dakar rental market.
  • Price limitations: Asking prices may exceed negotiated rents, potentially introducing upward bias and making predictions estimates of asking-price levels rather than rents actually paid.Negotiation between landlords and tenants is common, so displayed and agreed rents may differ.
  • Corpus limitations: Unbalanced neighborhood representation may limit generalization in areas with few observations.Broader, geographically balanced collection would improve corpus representativeness and comparisons across neighborhoods.
  • Uncertainty estimation: 64.2% empirical coverage falls below the targeted 80%, limiting the operational use of the prediction intervals.The test set contains 302 observations, and quantile-error optimization may be sensitive to hyperparameter choices.

6. Conclusion

The study builds an interpretable Dakar rent-prediction corpus and finds optimized XGBoost performs best among the evaluated approaches. SHAP identifies location as a major determinant, while asking prices, uneven coverage, and undercovered intervals limit application.

  • Study contribution: 1,507 observations were retained from 1,654 raw listings through rigorous preprocessing.The resulting corpus supports an interpretable machine learning approach for predicting residential rents in Dakar.
  • Interpretability: SHAP identifies location as one of Dakar’s main rent determinants and differs substantially from XGBoost gain-based importance.The conclusion emphasizes combining multiple interpretability methods.
  • Uncertainty estimation: 64.2% coverage was obtained against an 80% target for the quantile-regression intervals, so recalibration remains necessary before operational use.Conformal prediction is identified as one possible recalibration approach.
  • Implications: Rent differences between neighborhoods suggest potential value for tracking market pressures and informing urban planning and affordable-housing policies.This consequence is presented as a potential application of the predictive model.
  • Limitations: The study is limited by online-listing availability, asking prices, absent precise coordinates, uneven geographic coverage, and prediction intervals requiring recalibration.These boundaries define the scope of the reported benchmark.

Perspectives

Future work focuses on expanding the corpus, adding richer geographic information, improving interval reliability, and replacing asking prices with transaction prices. Longer-term infrastructure could support more representative national modeling.

  • Data expansion: Continuous data collection could enlarge the corpus and improve tracking of market developments over time.This would extend the temporal coverage of the dataset.
  • Geospatial enrichment: Precise distances to urban centers, transportation, beaches, and services could better measure location effects.These geospatial variables are proposed as additions to the current data.
  • Uncertainty estimation: Conformal-prediction recalibration is a priority for improving prediction-interval reliability.The proposal addresses the intervals’ need for improved calibration.
  • Data infrastructure: A national rental-transaction registry could provide negotiated rents and support models more representative of Senegal’s real estate market.This is described as a longer-term development.
Loading 2608.30865v1…