summaryrefslogtreecommitdiff
path: root/lib/dataset.rb
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2010-07-01 10:05:36 +0200
committerChristoph Helma <helma@in-silico.ch>2010-07-01 10:05:36 +0200
commitc024c22038eb2eb16d946132eca908412515c656 (patch)
tree003012a6fa5d851aeb43aee2ebf6414da4e50965 /lib/dataset.rb
parent1b7aa1e22b972f8d297b479319bc586033ee7385 (diff)
log level moved to config, model type detection updated
Diffstat (limited to 'lib/dataset.rb')
-rw-r--r--lib/dataset.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/dataset.rb b/lib/dataset.rb
index 1254992..fc4502a 100644
--- a/lib/dataset.rb
+++ b/lib/dataset.rb
@@ -86,8 +86,10 @@ module OpenTox
def get_predicted_class(compound, feature)
v = get_value(compound, feature)
if v.is_a?(Hash)
- if v.has_key?(:classification)
- return v[:classification]
+ k = v.keys.grep("classification")
+ unless k.empty?
+ #if v.has_key?(:classification)
+ return v[k]
else
return "no classification key"
end
@@ -107,7 +109,9 @@ module OpenTox
def get_prediction_confidence(compound, feature)
v = get_value(compound, feature)
if v.is_a?(Hash)
- if v.has_key?(:confidence)
+ k = v.keys.grep("confidence")
+ unless k.empty?
+ #if v.has_key?(:confidence)
return v[:confidence].abs
else
# PENDING: return nil isntead of raising an exception