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 CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
data/fBayes.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "fBayes"
8
- s.version = "0.2.1"
8
+ s.version = "0.2.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ivan Acosta-Rubio"]
@@ -11,8 +11,8 @@ puts "*" * 100
11
11
  puts "CDC CLASSIFIER"
12
12
  puts "*" * 100
13
13
 
14
- categories_path = Dir[ FBayesDir.root + "/cdc/data/*"]
15
- categories = categories_path.map{|path| path.gsub(FBayesDir.root + "/cdc/data/", "")}
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.root + "/cdc/data/#{category}")
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
 
@@ -4,9 +4,9 @@ puts "*" * 100
4
4
  puts "SR24 CLASSIFIER:"
5
5
  puts "*" * 100
6
6
 
7
- categories_path = Dir[ FBayesDir.root + "/data/*"]
7
+ categories_path = Dir[ FBayesDir.sr24_data + "*"]
8
8
 
9
- @categories = categories_path.map{|path| path.gsub(FBayesDir.root + "/data/", "")}
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.root + "data/#{category}")
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
@@ -4,6 +4,15 @@ module FBayesDir
4
4
  def self.root
5
5
  Gem::Specification.find_by_name("fBayes").gem_dir + "/lib/data/"
6
6
  end
7
+
8
+ def self.cdc_data
9
+ self.root + "/cdc/data/"
10
+ end
11
+
12
+ def self.sr24_data
13
+
14
+ self.root + "/sr24/data/"
15
+ end
7
16
  end
8
17
 
9
18
 
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.1
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: -2836690683508422044
187
+ hash: 778778263631434492
188
188
  required_rubygems_version: !ruby/object:Gem::Requirement
189
189
  none: false
190
190
  requirements: