Uber uses the RADAR ( Real-time Anomaly Detection And Response) tool to tag potential fraudsters attempting to get away without paying for the ride. The platform detects payment fraud by combining dozens of time signals. Recently, the ride-hailing company released a new version of Orbit 1.1 to improve the accuracy of RADAR.
Orbit, a general interface for Bayesian time series modelling, was introduced last year. The tool is built on probabilistic programming packages like PyStan and Uber’s Pyro and enables simple model specification and analysis without being restricted to a small number of models. As of now, Orbit has supported implementations of Exponential Smoothing (ETS), Damped Local Trend (DLT) and Local-Global Trend (LGT) forecasting models. With Uber’s latest update, Orbit v1.1 now has a new class design, forecaster and KTR that allows it to do a whole lot more.
The class design
Orbit 1.1 can be essentially identified with the new package design with three main classes:
- Forecaster
- Model Template
- Estimator
The Forecaster is the main interface users leverage for fitting, prediction, and posterior sample extraction. Forecaster, a wrapper class captures various Bayesian estimation flows based on its inner object. Along with the Model Template, the Forecaster defines the tasks to be performed. First, the model Template defines a specific model form, followed by the Estimator that defines the APIs to be used.
The class design decouples development in model research from numerical solutions. This allows developers to create new classes or improve the overall flow, depending on their requirements. For instance, Uber illustrates how developers looking to create a model type can work solely with the parent class Model. Those wanting to use APIs can add in a new Estimator, and those wanting to improve the workflow can do so through Forecaster.
Click here for a tutorial on creating a simple Bayesian linear model by mixing an Estimator and a Model on the fly.
All about the Forecaster
As part of a Syntax change in the calling models, users will have to supply estimator arguments in a string format. Instead of supplying the model with a ‘class’, users will have to input ‘stan-map’. A block of such code will lead to the output of a Forecaster object that serves a fit-and-predict purpose. Orbit 1.1 entails three types of Forecasters; Maximum a posteriori (MAP), Full Bayesian (MCMC), and Stochastic Variational Inference (SVI).
MAP is the fastest of the three forecasters. MCMC’s strength lies in handling correlated samples. SVI is faster than MCMC while preserving the latter’s forecasting abilities to situate correlated samples with poorly specified initial conditions.
Time-varying regression model: KTR
The KTR model leverages latent variables to create a smooth and time-varying representation of regression coefficients through the statistical technique of Kernel Smooths. Time-varying regression coefficients provide a cleaner way of modelling systems that update with time. The KTR is beneficial for Orbit 1.1 given its tendency to naturally decompose a signal into a thread, seasonality or externality. It can handle complex seasonality while flexibly representing coefficient curves. This allows the model to accommodate one-off or sudden events without the need for a defined impact or extent. Additionally, due to the minimal volume of parameters in the model, KTR is relatively fast while dealing with many regressors with low posterior variance.
Improved model diagnostics
In addition to new features, Orbit 1.1 also comes with a reformed model diagnostic and validation tool. The users can now choose their format to extract and export posterior samples, allowing them to run their plotting functions on the ArViz package, perform diagnostics, compare solutions using the insights provided by the representation. Python package, ArviZ, allows for better exploratory analysis of Bayesian models through posterior analysis, data storage, model checking, comparison and diagnostics. Its visualisations illustrate information regarding the density plot, pair plot, and trace plot helpful for insight creation.
Illustration a pair plots of posteriors
Orbit 1.1 applications
Uber is currently using the tool for anomaly detection in RADAR and infrastructure capacity planning. Orbit 1.1 helps Uber meet the server load requirements with its on-premise and cloud solutions for compute and storage.
Orbit 1.1 has performed well on the team’s internal backtesting dashboard and metrics, including the successful run rate. The tool was tested on the benchmarks of SARIMA and Prophet and successfully proved Orbit’s correctness on different datasets.