multi_armed_bandit 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -4
- data/lib/multi_armed_bandit/mp_ts.rb +2 -2
- data/lib/multi_armed_bandit/version.rb +1 -1
- data/multi_armed_bandit.gemspec +5 -5
- metadata +4 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ffdbe1749d41f4df55c0dba3223391e762d3eea
|
4
|
+
data.tar.gz: 739a82ab2b4f7122c8ef10668a88638f7e228afd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bde94f911c19f94f6efa3e2b39a54e3c6d5aed43af90bc2943123622cf210cab68ef30dbaffa337d016277285aecfee4ccaaa9cf414b1ca1438cb1c239149d6c
|
7
|
+
data.tar.gz: 37881e19f8596712b1840a94434813e276025d40d7db9418a0cbf5e42b38f8c8222888f2cfa6b8caa496aede5f9af1c37319320d66d0f9bc2fd5f96e81906689
|
data/README.md
CHANGED
@@ -4,16 +4,15 @@ This repo contains Ruby code for solving Multi-Armed Bandit problems. This inclu
|
|
4
4
|
|
5
5
|
* Epsilon-Greedy
|
6
6
|
* Softmax
|
7
|
-
* Thomson Sampling
|
7
|
+
* Multiple-play Thomson Sampling
|
8
8
|
|
9
9
|
Othrer major algorithms such as UCB and Bayesian Bandit will be forthcoming.
|
10
10
|
|
11
11
|
## Installation
|
12
12
|
|
13
|
-
By executing the following line, you can install the gem from
|
14
|
-
|
15
|
-
$ gem specific_install -l 'git://github.com/vasilyjp/multi_armed_bandit.git'
|
13
|
+
By executing the following line, you can install the gem from RubyGems.
|
16
14
|
|
15
|
+
$ gem install multi_armed_bandit
|
17
16
|
|
18
17
|
## Usage
|
19
18
|
|
@@ -8,12 +8,12 @@ module MultiArmedBandit
|
|
8
8
|
|
9
9
|
# k: num of arms
|
10
10
|
# l: num of selected arms
|
11
|
-
def initialize(k, l, setseed=
|
11
|
+
def initialize(k, l, setseed=true)
|
12
12
|
@k = k
|
13
13
|
@l = l
|
14
14
|
@r = SimpleRandom.new
|
15
15
|
# By default the same random seed is used, so we change it
|
16
|
-
@r.set_seed if setseed==
|
16
|
+
@r.set_seed if setseed==true
|
17
17
|
reset
|
18
18
|
end
|
19
19
|
|
data/multi_armed_bandit.gemspec
CHANGED
@@ -16,11 +16,11 @@ Gem::Specification.new do |spec|
|
|
16
16
|
|
17
17
|
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
|
18
18
|
# delete this section to allow pushing this gem to any host.
|
19
|
-
if spec.respond_to?(:metadata)
|
20
|
-
spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
|
21
|
-
else
|
22
|
-
raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
|
23
|
-
end
|
19
|
+
# if spec.respond_to?(:metadata)
|
20
|
+
# spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
|
21
|
+
# else
|
22
|
+
# raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
|
23
|
+
# end
|
24
24
|
|
25
25
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
26
26
|
spec.bindir = "exe"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: multi_armed_bandit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kndt84
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -90,8 +90,7 @@ files:
|
|
90
90
|
homepage: https://github.com/vasilyjp/multi_armed_bandit
|
91
91
|
licenses:
|
92
92
|
- MIT
|
93
|
-
metadata:
|
94
|
-
allowed_push_host: 'TODO: Set to ''http://mygemserver.com'''
|
93
|
+
metadata: {}
|
95
94
|
post_install_message:
|
96
95
|
rdoc_options: []
|
97
96
|
require_paths:
|
@@ -108,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
107
|
version: '0'
|
109
108
|
requirements: []
|
110
109
|
rubyforge_project:
|
111
|
-
rubygems_version: 2.
|
110
|
+
rubygems_version: 2.4.8
|
112
111
|
signing_key:
|
113
112
|
specification_version: 4
|
114
113
|
summary: multi-armed bandit algorithms
|