KatInterview

Hourly Demand Forecasting for Shared Mobility Systems

Machine LearningModel answer
HardModel answerMachine Learningtime-seriesfeature-engineeringoverfitting

Last updated

Build a model to forecast hourly demand at individual stations in a bike-sharing network, handling time-series structure, censored observations, and overfitting risks.

You're building a forecasting system for a bike-sharing network operating across a city. The dataset contains historical records with these attributes: station identifier, hourly timestamps, counts of bikes picked up and returned, total dock capacity, snapshot of bikes present at each hour, weather conditions, holiday indicators, and signals from nearby transit hubs or local events.

Your task is to build a model that forecasts how many bikes will be picked up from a given station in the upcoming hour.

Address these aspects in your response:

  • How you'll formulate the prediction target and prevent information leakage from future data
  • Which features you'll construct from time patterns, station characteristics, weather data, and location attributes
  • What temporal splitting strategy you'll apply for training, validation, and testing
  • Which evaluation metric(s) you'll select (such as MAE, RMSE, Poisson loss, or metrics tied to operational outcomes like empty docks) and why
  • Your approach to identifying and mitigating overfitting

Provide concrete examples and explain your reasoning.

Hints

Hint 1

Observed pickups may be constrained by available inventory—consider whether you're predicting observed demand or latent demand

Hint 2

Time-based data requires forward-only validation; random splits will leak future information into training

Hint 3

Features computed from historical data must be recalculated separately within each training fold to avoid leakage