-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathindex.html
254 lines (228 loc) · 16.8 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="./">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>MABWiser Contextual Multi-Armed Bandits — MABWiser 2.7.4 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=80d5e7a1" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=19f00094" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=e8140b17"></script>
<script src="_static/doctools.js?v=888ff710"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/js/theme.js"></script>
<link rel="author" title="About these documents" href="about.html" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="About Multi-Armed Bandits" href="about.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="#" class="icon icon-home">
MABWiser
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<ul>
<li class="toctree-l1"><a class="reference internal" href="about.html">About Multi-Armed Bandits</a></li>
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="quick.html">Quick Start</a></li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Usage Examples</a></li>
<li class="toctree-l1"><a class="reference internal" href="contributing.html">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="new_bandit.html">Adding a New Bandit</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">MABWiser Public API</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="#">MABWiser</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="#" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">MABWiser Contextual Multi-Armed Bandits</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/index.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="mabwiser-contextual-multi-armed-bandits">
<h1>MABWiser Contextual Multi-Armed Bandits<a class="headerlink" href="#mabwiser-contextual-multi-armed-bandits" title="Link to this heading"></a></h1>
<p>MABWiser is a research library for fast prototyping of multi-armed bandit algorithms.
It supports <strong>context-free</strong>, <strong>parametric</strong> and <strong>non-parametric</strong> <strong>contextual</strong> bandit models.
It provides built-in parallelization for both training and testing components and
a simulation utility for algorithm comparisons and hyper-parameter tuning.
The library follows the scikit-learn style, adheres to <a class="reference external" href="https://www.python.org/dev/peps/pep-0008/">PEP-8 standards</a>, and is tested heavily.
MABWiser is released by Fidelity Investments Artificial Intelligence Center of Excellence.</p>
</section>
<section id="quick-start">
<h1>Quick Start<a class="headerlink" href="#quick-start" title="Link to this heading"></a></h1>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># An example that shows how to use the UCB1 learning policy</span>
<span class="c1"># to make decisions between two arms based on their expected rewards.</span>
<span class="c1"># Import MABWiser Library</span>
<span class="kn">from</span> <span class="nn">mabwiser.mab</span> <span class="kn">import</span> <span class="n">MAB</span><span class="p">,</span> <span class="n">LearningPolicy</span><span class="p">,</span> <span class="n">NeighborhoodPolicy</span>
<span class="c1"># Data</span>
<span class="n">arms</span> <span class="o">=</span> <span class="p">[</span><span class="s1">'Arm1'</span><span class="p">,</span> <span class="s1">'Arm2'</span><span class="p">]</span>
<span class="n">decisions</span> <span class="o">=</span> <span class="p">[</span><span class="s1">'Arm1'</span><span class="p">,</span> <span class="s1">'Arm1'</span><span class="p">,</span> <span class="s1">'Arm2'</span><span class="p">,</span> <span class="s1">'Arm1'</span><span class="p">]</span>
<span class="n">rewards</span> <span class="o">=</span> <span class="p">[</span><span class="mi">20</span><span class="p">,</span> <span class="mi">17</span><span class="p">,</span> <span class="mi">25</span><span class="p">,</span> <span class="mi">9</span><span class="p">]</span>
<span class="c1"># Model</span>
<span class="n">mab</span> <span class="o">=</span> <span class="n">MAB</span><span class="p">(</span><span class="n">arms</span><span class="p">,</span> <span class="n">LearningPolicy</span><span class="o">.</span><span class="n">UCB1</span><span class="p">(</span><span class="n">alpha</span><span class="o">=</span><span class="mf">1.25</span><span class="p">))</span>
<span class="c1"># Train</span>
<span class="n">mab</span><span class="o">.</span><span class="n">fit</span><span class="p">(</span><span class="n">decisions</span><span class="p">,</span> <span class="n">rewards</span><span class="p">)</span>
<span class="c1"># Test</span>
<span class="n">mab</span><span class="o">.</span><span class="n">predict</span><span class="p">()</span>
</pre></div>
</div>
<aside class="sidebar">
<p class="sidebar-title">Contents</p>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="about.html">About Multi-Armed Bandits</a></li>
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a><ul>
<li class="toctree-l2"><a class="reference internal" href="installation.html#requirements">Requirements</a></li>
<li class="toctree-l2"><a class="reference internal" href="installation.html#source-code">Source Code</a></li>
<li class="toctree-l2"><a class="reference internal" href="installation.html#test-your-setup">Test Your Setup</a></li>
<li class="toctree-l2"><a class="reference internal" href="installation.html#upgrade-the-library">Upgrade the Library</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="quick.html">Quick Start</a></li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Usage Examples</a><ul>
<li class="toctree-l2"><a class="reference internal" href="examples.html#context-free-mab">Context-Free MAB</a></li>
<li class="toctree-l2"><a class="reference internal" href="examples.html#parametric-contextual-mab">Parametric Contextual MAB</a></li>
<li class="toctree-l2"><a class="reference internal" href="examples.html#non-parametric-contextual-mab">Non-Parametric Contextual MAB</a></li>
<li class="toctree-l2"><a class="reference internal" href="examples.html#parallel-mab">Parallel MAB</a></li>
<li class="toctree-l2"><a class="reference internal" href="examples.html#simulator">Simulator</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="contributing.html">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="new_bandit.html">Adding a New Bandit</a><ul>
<li class="toctree-l2"><a class="reference internal" href="new_bandit.html#exposing-the-public-api">1. Exposing the Public API</a></li>
<li class="toctree-l2"><a class="reference internal" href="new_bandit.html#implementing-the-bandit-algorithm">2. Implementing the Bandit Algorithm</a></li>
<li class="toctree-l2"><a class="reference internal" href="new_bandit.html#testing-the-bandit-algorithm">3. Testing the Bandit Algorithm</a></li>
<li class="toctree-l2"><a class="reference internal" href="new_bandit.html#sending-a-pull-request">4. Sending a Pull Request</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="api.html">MABWiser Public API</a><ul>
<li class="toctree-l2"><a class="reference internal" href="api.html#module-mabwiser.base_mab">base_mab</a></li>
<li class="toctree-l2"><a class="reference internal" href="api.html#module-mabwiser.mab">mab</a></li>
<li class="toctree-l2"><a class="reference internal" href="api.html#module-mabwiser.simulator">simulator</a></li>
<li class="toctree-l2"><a class="reference internal" href="api.html#module-mabwiser.utils">utils</a></li>
</ul>
</li>
</ul>
</div>
</aside>
</section>
<section id="source-code">
<h1>Source Code<a class="headerlink" href="#source-code" title="Link to this heading"></a></h1>
<p>The source code is hosted on <a class="reference external" href="https://github.com/fidelity/mabwiser">GitHub</a>.</p>
</section>
<section id="available-bandit-policies">
<h1>Available Bandit Policies<a class="headerlink" href="#available-bandit-policies" title="Link to this heading"></a></h1>
<p>Available Learning Policies:</p>
<ul class="simple">
<li><p>Epsilon Greedy</p></li>
<li><p>LinGreedy</p></li>
<li><p>LinTS</p></li>
<li><p>LinUCB</p></li>
<li><p>Popularity</p></li>
<li><p>Random</p></li>
<li><p>Softmax</p></li>
<li><p>Thompson Sampling (TS)</p></li>
<li><p>Upper Confidence Bound (UCB1)</p></li>
</ul>
<p>Available Neighborhood Policies:</p>
<ul class="simple">
<li><p>Clusters</p></li>
<li><p>K-Nearest</p></li>
<li><p>LSH Nearest</p></li>
<li><p>Radius</p></li>
<li><p>TreeBandit</p></li>
</ul>
</section>
<section id="bug-reports">
<h1>Bug Reports<a class="headerlink" href="#bug-reports" title="Link to this heading"></a></h1>
<p>Please use the GitHub <a class="reference external" href="https://github.com/fidelity/mabwiser/issues">Issues</a> tracking for bug reports and feature requests.</p>
</section>
<section id="citation">
<h1>Citation<a class="headerlink" href="#citation" title="Link to this heading"></a></h1>
<p>You can cite MABWiser as:</p>
<ul class="simple">
<li><p><strong>[IJAIT 2021]</strong> <a class="reference external" href="https://www.worldscientific.com/doi/abs/10.1142/S0218213021500214">E. Strong, B. Kleynhans, and S. Kadioglu, “MABWiser: Parallelizable Contextual Multi-Armed Bandits”</a></p></li>
<li><p><strong>[ICTAI 2019]</strong> <a class="reference external" href="https://ieeexplore.ieee.org/document/8995418">E. Strong, B. Kleynhans, and S. Kadioglu, “MABWiser: A Parallelizable Contextual Multi-Armed Bandit Library for Python”</a></p></li>
</ul>
<div class="highlight-bibtex notranslate"><div class="highlight"><pre><span></span><span class="nc">@article</span><span class="p">{</span><span class="nl">DBLP:journals/ijait/StrongKK21</span><span class="p">,</span>
<span class="w"> </span><span class="na">author</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="s">{Emily Strong and Bernard Kleynhans and Serdar Kadioglu}</span><span class="p">,</span>
<span class="w"> </span><span class="na">title</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="s">{{MABWiser:} Parallelizable Contextual Multi-armed Bandits}</span><span class="p">,</span>
<span class="w"> </span><span class="na">journal</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="s">{Int. J. Artif. Intell. Tools}</span><span class="p">,</span>
<span class="w"> </span><span class="na">volume</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="s">{30}</span><span class="p">,</span>
<span class="w"> </span><span class="na">number</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="s">{4}</span><span class="p">,</span>
<span class="w"> </span><span class="na">pages</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="s">{2150021:1--2150021:19}</span><span class="p">,</span>
<span class="w"> </span><span class="na">year</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="s">{2021}</span><span class="p">,</span>
<span class="w"> </span><span class="na">url</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="s">{https://doi.org/10.1142/S0218213021500214}</span><span class="p">,</span>
<span class="w"> </span><span class="na">doi</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="s">{10.1142/S0218213021500214}</span><span class="p">,</span>
<span class="p">}</span>
<span class="nc">@inproceedings</span><span class="p">{</span><span class="nl">DBLP:conf/ictai/StrongKK19</span><span class="p">,</span>
<span class="w"> </span><span class="na">author</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="s">{Emily Strong and Bernard Kleynhans and Serdar Kadioglu}</span><span class="p">,</span>
<span class="w"> </span><span class="na">title</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="s">{MABWiser: {A} Parallelizable Contextual Multi-Armed Bandit Library for Python}</span><span class="p">,</span>
<span class="w"> </span><span class="na">booktitle</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="s">{31st {IEEE} International Conference on Tools with Artificial Intelligence, {ICTAI} 2019, Portland, OR, USA, November 4-6, 2019}</span><span class="p">,</span>
<span class="w"> </span><span class="na">pages</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="s">{909--914}</span><span class="p">,</span>
<span class="w"> </span><span class="na">publisher</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="s">{{IEEE}}</span><span class="p">,</span>
<span class="w"> </span><span class="na">year</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="s">{2019}</span><span class="p">,</span>
<span class="w"> </span><span class="na">url</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="s">{https://doi.org/10.1109/ICTAI.2019.00129}</span><span class="p">,</span>
<span class="w"> </span><span class="na">doi</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="s">{10.1109/ICTAI.2019.00129}</span><span class="p">,</span>
<span class="p">}</span>
</pre></div>
</div>
</section>
<section id="indices-and-tables">
<h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Link to this heading"></a></h1>
<ul class="simple">
<li><p><a class="reference internal" href="genindex.html"><span class="std std-ref">Index</span></a></p></li>
<li><p><a class="reference internal" href="py-modindex.html"><span class="std std-ref">Module Index</span></a></p></li>
</ul>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="about.html" class="btn btn-neutral float-right" title="About Multi-Armed Bandits" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>© Copyright Copyright (C), FMR LLC.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>