summaryrefslogtreecommitdiff
path: root/lib/predictions.rb
diff options
context:
space:
mode:
authormguetlein <martin.guetlein@gmail.com>2010-07-28 10:08:09 +0200
committermguetlein <martin.guetlein@gmail.com>2010-07-28 10:08:09 +0200
commitce0121c8d5e77e8f4cb9654d372a8745e9b3ef10 (patch)
tree6f55852336da3b236466c8f5bd7a56d0e9c6af1e /lib/predictions.rb
parent2a4fe800d1fad7da3a835f664ce1af864e827c0f (diff)
remove rdf_provider to use rewritten owl.rb in wrapper
Diffstat (limited to 'lib/predictions.rb')
-rw-r--r--lib/predictions.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/predictions.rb b/lib/predictions.rb
index f6351f8..2873689 100644
--- a/lib/predictions.rb
+++ b/lib/predictions.rb
@@ -441,8 +441,8 @@ module Lib
def sample_correlation_coefficient
# formula see http://en.wikipedia.org/wiki/Correlation_and_dependence#Pearson.27s_product-moment_coefficient
return ( @num_predicted * @sum_multiply - @sum_actual * @sum_predicted ) /
- ( Math.sqrt( @num_predicted * @sum_squares_actual - @sum_actual**2 ) *
- Math.sqrt( @num_predicted * @sum_squares_predicted - @sum_predicted**2 ) )
+ ( Math.sqrt( [0, @num_predicted * @sum_squares_actual - @sum_actual**2].max ) *
+ Math.sqrt( [0, @num_predicted * @sum_squares_predicted - @sum_predicted**2].max ) )
end
def total_sum_of_squares