bayesball 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 478528e5894a3dedc57435782136dae425e36c49
4
- data.tar.gz: 2c6b799680658bb607031eee0b4ca985eff6f14a
3
+ metadata.gz: 8ce4bfb61252ea0761c5d9709fe7a3b4ac3ca4da
4
+ data.tar.gz: 9998148ae40301923e4164c56d19309d5ea7da48
5
5
  SHA512:
6
- metadata.gz: f28d402de88b753a1fe012e5e7e3cabdf59a8c001d6154fcd02d237fe1d66462922e50dffd9f18cb6900d92d0be4d6dd5a98c148d5c0686a4e6d11651fc7c2cb
7
- data.tar.gz: 804e9ebdc8a73a5fe741482ffa2282624227530b136fac9a1faf52bee0b0f0e4dde152e163a104b9d47f267a44171d97d4d25a63200606aea1d31899cd519bf7
6
+ metadata.gz: b31bcb3c7798385cfd0534cd4bbf17d55a20c4524c71ec53d7f7e59477f37157fe5f141e57104bb731e31fc5a3f0aa441915d4673e85d0307f2e8e51aae0795e
7
+ data.tar.gz: bfc8c9f2e3615e3ee2ba1ac2a027291287e4d98a87cb6e47a8d832e8b4dc91b53c1d9c68d87a1526c9bc176b8aae486c6a3dced5f7028c7951e753fe39560cbd
@@ -38,5 +38,11 @@ module Bayesball
38
38
  s = score(payload)
39
39
  s.sort_by{|_,v| v}.map{|k,_| k}.reverse.first
40
40
  end
41
+
42
+ def seed(content)
43
+ content.each do |category, counts|
44
+ @persistence[category] = counts
45
+ end
46
+ end
41
47
  end
42
48
  end
@@ -1,3 +1,3 @@
1
1
  module Bayesball
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -12,7 +12,12 @@ describe Bayesball::Classifier do
12
12
  subject.train('basketball', 'The ball went in the hoop')
13
13
  subject.train('baseball', 'He hit another grand slam!')
14
14
 
15
- result = subject.score('The ball went in the hoop')
15
+ subject.score('The ball went in the hoop')
16
+ end
17
+
18
+ it 'should accept a seed' do
19
+ subject.seed('basketball' => { 'hoop' => 1 })
20
+ subject.classify('hoop').must_equal 'basketball'
16
21
  end
17
22
 
18
23
  it 'should classify' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bayesball
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Staten
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-13 00:00:00.000000000 Z
11
+ date: 2014-01-03 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A bayes classifier
14
14
  email: