Real world Use Cases: Forecasting Service Utilization Using Tabnet and Optuna

Hampus Gustavsson15 Aug 2024

Problem

A client needed to forecast the usage of one service. The forecast fed resource allocation for running the service and dynamic pricing. Knowledge about usage patterns lived mostly with experienced coworkers who might retire and take it with them, and the tool was also meant to speed up onboarding of new hires. The data had many categorical and numerical features. Several correlated and uncorrelated target values had to be forecast, and the horizon changed from case to case.

Example from the article: a usage series plotted from 2016 to 2024, forecast 365 days ahead with an 80% interval.

Solution in brief

Treat the multivariate forecast as a tabular regression problem and fit TabNet as a quantile regression with the pinball loss, which gives an interval instead of a point. Tune it with Optuna (Bayesian search, early stopping, warm start) on a time-ordered 80/10/10 split. Use the built-in feature importance so the client can sanity-check the model.

Questions this case answers
  • How to forecast several correlated demand series over a variable horizon when the knowledge of how demand behaves sits with a few experts
  • How to produce forecast intervals and feature-level explanations from one model so non-technical stakeholders can validate it
  • How to forecast the usage of a service for several horizons at once, with an uncertainty band the business can plan against?
  • How to tune a neural tabular model on a long daily series without leaking the future into training?

Tools and methods

  • TabNet — neural model for tabular data with built-in local and global feature importance
  • Quantile regression with pinball loss — gives lower and upper bounds for heteroscedastic residuals
  • Optuna — Bayesian hyperparameter search with early stopping and warm start from stored trials
  • Time-ordered train, validation and test split — mimics deployment
  • Deepchecks — novelty score on predicted points to flag drift
Continue reading — it's free

Google or a one-time email code. No password.