{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Contextual Bandits with Parametric Actions -- Experimentation Mode" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "---\n", "\n", "This notebook's CI test result for us-west-2 is as follows. CI test results in other regions can be found at the end of the notebook. \n", "\n", "\n", "\n", "---" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We demonstrate how you can use varying number of actions with contextual bandits algorithms in SageMaker. This notebook builds on \n", "the [Contextual Bandits example notebook](https://github.com/awslabs/amazon-sagemaker-examples/blob/master/reinforcement_learning/bandits_statlog_vw_customEnv/bandits_statlog_vw_customEnv.ipynb) example notebook which used fixed number of actions. Please refer to that notebook for basics on contextual \n", "bandits. \n", "\n", "In the contextual bandit setting, an agent recommends an action given a state. This notebook introduces three features to bandit algorithms that make them applicable to a broader set of real-world problems. We use the movie recommendation problem as an example.\n", "1. The number of actions available to the agent can change over time. For example, the movies in the catalog changes over time.\n", "2. Each action may have features associated with it. For the movie recommendation problem, each movie can have features such as \n", "genre, cast, etc.\n", "3. The agent can produce a ranked list of actions/items. When recommending movies, it is natural that multiple movies are recommended at a time step.\n", "\n", "The contextual bandit agent will trade-off between exploitation and exploration to quickly learn user preferences and minimize \n", "poor recommendations. The bandit algorithms are appropriate to use in recommendation problems when there are many cold items (items which have no or little interaction data) in the catalog or if user preferences change over time." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### What is Experimentation Mode?\n", "\n", "Contextual bandits are often used to train models by interacting with the real world. In movie recommendation, the bandit learns user preferences based on their feedback from past interactions. To test if bandit algorithms are applicable for your use case, you may want to test different algorithms and understand the impact of different features, hyper-parameters. Experimenting with real users can lead to poor experience due to unanticipated issues or poor performance. Experimenting in production comes with the complexity of working with infrastructure components (e.g. web services, data engines, databases) designed for scale. With Experimentation Mode, you can get started with a small dataset or a simulator and identify the algorithm, features and hyper-parameters that are best applicable for your use case. The experimentation is much faster, does not impact real users and easy to work with. Once you are satisfied with the algorithm performance, you can switch to [Deployment Mode](https://github.com/awslabs/amazon-sagemaker-examples/blob/master/reinforcement_learning/bandits_statlog_vw_customEnv/bandits_statlog_vw_customEnv.ipynb), where we provide infrastructure support that scales to production requirements." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n",
" \n",
"