diff options
author | mguetlein <martin.guetlein@gmail.com> | 2011-07-13 10:15:47 +0200 |
---|---|---|
committer | mguetlein <martin.guetlein@gmail.com> | 2011-07-13 10:15:47 +0200 |
commit | 6600fd4d25c4bb34dfdf17b539d3598b112ffd2a (patch) | |
tree | 351aaa3fac6df7e63295b7fb9f8324da05c132b2 | |
parent | 2909344873532a1c7cc2a5ac80a8222e9828bc99 (diff) |
fix valid prediction values check for regression validation
-rwxr-xr-x | lib/predictions.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/predictions.rb b/lib/predictions.rb index f4fb461..a4c57a0 100755 --- a/lib/predictions.rb +++ b/lib/predictions.rb @@ -55,11 +55,11 @@ module Lib values.each{ |v| raise "illegal "+s+" classification-value ("+v.to_s+"),"+ "has to be either nil or index of predicted-values" if v!=nil and (!v.is_a?(Numeric) or v<0 or v>@num_classes)} end - when "regresssion" + when "regression" raise "accept_values != nil while performing regression" if @accept_values { "predicted"=>@predicted_values, "actual"=>@actual_values }.each do |s,values| values.each{ |v| raise "illegal "+s+" regression-value ("+v.to_s+"),"+ - "has to be either nil or number (not NaN, not Infinite)" if v!=nil and (!v.is_a?(Numeric) or v.nan? or v.finite?)} + " has to be either nil or number (not NaN, not Infinite)" unless v==nil or (v.is_a?(Numeric) and !v.nan? and v.finite?)} end end |