summaryrefslogtreecommitdiff
path: root/lib/predictions.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/predictions.rb')
-rwxr-xr-xlib/predictions.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/predictions.rb b/lib/predictions.rb
index 4e34c90..082ad10 100755
--- a/lib/predictions.rb
+++ b/lib/predictions.rb
@@ -146,9 +146,9 @@ module Lib
delta = predicted_value - actual_value
@sum_error += delta
@sum_abs_error += delta.abs
- @sum_weighted_abs_error += delta.abs*confidence_value
+ @sum_weighted_abs_error += delta.abs*confidence_value if @conf_provided
@sum_squared_error += delta**2
- @sum_weighted_squared_error += (delta**2)*confidence_value
+ @sum_weighted_squared_error += (delta**2)*confidence_value if @conf_provided
old_prediction_mean = @prediction_mean
@prediction_mean = (@prediction_mean * (@num_predicted-1) + predicted_value) / @num_predicted.to_f