summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormguetlein <martin.guetlein@gmail.com>2011-05-31 23:28:02 +0200
committermguetlein <martin.guetlein@gmail.com>2011-05-31 23:28:02 +0200
commitb435b145aea744ba951c12b4f6bf90ce62a5b0a3 (patch)
tree27f4e5d9afa210c395c44cf9f0d0e233326a6767
parentd69214b494706fb53f74bb17ddde28ad831cd460 (diff)
skip 0 regression value instead of stopping model buliding
-rw-r--r--lazar.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lazar.rb b/lazar.rb
index a8de64a..4e5d41d 100644
--- a/lazar.rb
+++ b/lazar.rb
@@ -157,8 +157,12 @@ post '/lazar/?' do
LOGGER.warn "Unknown class \"#{value.to_s}\"."
end
elsif prediction_feature.feature_type == "regression"
- halt 404, "0 values not allowed in training dataset. log10 is calculated internally." if value.to_f == 0
- lazar.activities[compound] << value.to_f
+ #never use halt in tasks, do not raise exception when, print warning instead
+ if value.to_f==0
+ LOGGER.warn "0 values not allowed in training dataset. log10 is calculated internally. skipping compound"
+ else
+ lazar.activities[compound] << value.to_f
+ end
end
end
end