fBayes 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/fBayes.gemspec +1 -1
- data/lib/data/cdc/classifier.rb +3 -6
- data/lib/data/sr24/classifier.rb +3 -3
- data/lib/fBayes.rb +9 -0
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.2
|
data/fBayes.gemspec
CHANGED
data/lib/data/cdc/classifier.rb
CHANGED
@@ -11,8 +11,8 @@ puts "*" * 100
|
|
11
11
|
puts "CDC CLASSIFIER"
|
12
12
|
puts "*" * 100
|
13
13
|
|
14
|
-
categories_path = Dir[ FBayesDir.
|
15
|
-
categories = categories_path.map{|path| path.gsub(FBayesDir.
|
14
|
+
categories_path = Dir[ FBayesDir.cdc_data + "*"]
|
15
|
+
categories = categories_path.map{|path| path.gsub(FBayesDir.cdc_data, "")}
|
16
16
|
@cdc_classifier = Classifier::Bayes.new
|
17
17
|
|
18
18
|
categories.each do |c|
|
@@ -24,12 +24,9 @@ total_size = 0
|
|
24
24
|
|
25
25
|
categories.each do |category|
|
26
26
|
method = "train_" + category.downcase
|
27
|
-
data = File.read( FBayesDir.
|
28
|
-
|
29
|
-
|
27
|
+
data = File.read( FBayesDir.cdc_data + category.to_s )
|
30
28
|
puts category +": " + data.size.to_s
|
31
29
|
total_size += data.size.to_i
|
32
|
-
|
33
30
|
@cdc_classifier.send(method, data)
|
34
31
|
end
|
35
32
|
|
data/lib/data/sr24/classifier.rb
CHANGED
@@ -4,9 +4,9 @@ puts "*" * 100
|
|
4
4
|
puts "SR24 CLASSIFIER:"
|
5
5
|
puts "*" * 100
|
6
6
|
|
7
|
-
categories_path = Dir[ FBayesDir.
|
7
|
+
categories_path = Dir[ FBayesDir.sr24_data + "*"]
|
8
8
|
|
9
|
-
@categories = categories_path.map{|path| path.gsub(FBayesDir.
|
9
|
+
@categories = categories_path.map{|path| path.gsub(FBayesDir.sr24_data, "")}
|
10
10
|
|
11
11
|
@sr24_classifier = Classifier::Bayes.new
|
12
12
|
|
@@ -19,7 +19,7 @@ total_size = 0
|
|
19
19
|
|
20
20
|
@categories.each do |category|
|
21
21
|
method = "train_" + category.downcase
|
22
|
-
data = File.read( FBayesDir.
|
22
|
+
data = File.read( FBayesDir.sr24_data + category.to_s)
|
23
23
|
puts category +": " + data.size.to_s
|
24
24
|
@sr24_classifier.send(method, data)
|
25
25
|
total_size += data.size.to_i
|
data/lib/fBayes.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fBayes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -184,7 +184,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
184
184
|
version: '0'
|
185
185
|
segments:
|
186
186
|
- 0
|
187
|
-
hash:
|
187
|
+
hash: 778778263631434492
|
188
188
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
189
189
|
none: false
|
190
190
|
requirements:
|