Class: Skab::Output::Summary
- Inherits:
-
Object
- Object
- Skab::Output::Summary
- Defined in:
- lib/skab/output/summary.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(out) ⇒ Summary
constructor
A new instance of Summary.
- #output(model) ⇒ Object
Constructor Details
#initialize(out) ⇒ Summary
Returns a new instance of Summary.
4 5 6 |
# File 'lib/skab/output/summary.rb', line 4 def initialize(out) @out = out end |
Class Method Details
.help ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/skab/output/summary.rb', line 25 def self.help <<-HELP Usage: skab summary [model] [parameters] \tOutputs a summary of the whole statistical analysis conducted on A and \tB, using the specified model. HELP end |
Instance Method Details
#output(model) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/skab/output/summary.rb', line 8 def output(model) sum = 0.0 min = 0 max = 0 Hash[model.differential.sort].each do |k, v| sum += v if min == 0 || sum <= 0.05 min = k end if max == 0 && sum >= 0.95 max = k end end @out.puts "The difference is located between #{min} and #{max} (90% confidence)" end |