nimbus 0.2 → 0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28,7 +28,7 @@ module Nimbus
28
28
  end
29
29
 
30
30
  # Stops the execution of the Nimbus application.
31
- def stop(msg = "Error: Nimbus finished.") # :nodoc:
31
+ def stop(msg = "Error: Nimbus finished.")
32
32
  STDERR.puts msg
33
33
  exit(false)
34
34
  end
@@ -142,7 +142,7 @@ module Nimbus
142
142
  Nimbus.message "* Nimbus configured with the following parameters: "
143
143
  Nimbus.message "* Forest size: #{@forest_size} trees"
144
144
  Nimbus.message "* Total SNP count: #{@tree_SNP_total_count}"
145
- Nimbus.message "* SNPs sample size (mtry): #{@SNP_sample_size}"
145
+ Nimbus.message "* SNPs sample size (mtry): #{@tree_SNP_sample_size}"
146
146
  Nimbus.message "* Maximum number of branches per tree: #{@tree_max_branches}"
147
147
  Nimbus.message "* Minimun node size in tree: #{@tree_node_min_size}"
148
148
  Nimbus.message "*" * 50
@@ -9,6 +9,7 @@ module Nimbus
9
9
  @options = config
10
10
  @size = config.forest_size
11
11
  @predictions = {}
12
+ @times_predicted =[]
12
13
  raise Nimbus::ForestError, "Forest size parameter (#{@size}) is invalid. You need at least one tree." if @size < 1
13
14
  end
14
15
 
@@ -46,15 +47,17 @@ module Nimbus
46
47
  preds.each_pair.each{|id, value|
47
48
  if @predictions[id].nil?
48
49
  @predictions[id] = value
50
+ @times_predicted[id] = 1.0
49
51
  else
50
52
  @predictions[id] += value
53
+ @times_predicted[id] += 1
51
54
  end
52
55
  }
53
56
  end
54
57
 
55
58
  def average_predictions
56
59
  @predictions.each_pair{|id, value|
57
- @predictions[id] = (@predictions[id] / @size).round(5)
60
+ @predictions[id] = (@predictions[id] / @times_predicted[id]).round(5)
58
61
  }
59
62
  end
60
63
 
@@ -1,3 +1,2 @@
1
1
  # encoding: UTF-8
2
- require File.dirname(__FILE__) + '/spec_helper'
3
-
2
+ require File.dirname(__FILE__) + '/spec_helper'
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: nimbus
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: "0.2"
5
+ version: "0.3"
6
6
  platform: ruby
7
7
  authors:
8
8
  - "Juanjo Baz\xC3\xA1n"
@@ -11,7 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2011-08-03 00:00:00 Z
14
+ date: 2011-08-19 00:00:00 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rspec