Bandit Experiments
Advanced Bandit Usage
Both contextual and non-contextual bandits are managed on Statsig’s console, or through Statsig’s console API for programmatic creation. Both bandit types use a common, streamlined API, making it easy to explore either use case without significant changes from using experiments.
Statsig’s bandits are designed to provide the power of complex bandits with a simple interface - an observation we made in development is that many of these systems are stymied by implementation issues.
There’s no additional steps beyond a regular experiment check to use a bandit, though for contextual multi-armed bandits you will want to make sure that you attach any context to your user object (usually at initialization) before making the experiment check. This can easily be confirmed in the diagnostics tab of your bandit in console.
and accessing it in code using the same pattern as experiments:
This is separated from a bandit’s linked experiment call to reduce excessive logging; if you have a linked wrapping experiment, you can just wrap the call after checking the experiment.
Statsig will automatically detect and differentiate categorical and numerical features based on cardinality.