From c024c22038eb2eb16d946132eca908412515c656 Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Thu, 1 Jul 2010 10:05:36 +0200 Subject: log level moved to config, model type detection updated --- lib/dataset.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lib/dataset.rb') 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 -- cgit v1.2.3