From cab2c3249e729cc9c6be3a4a306b05d60f8f9f2e Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Tue, 10 Apr 2012 14:05:12 +0200 Subject: Added common value_map routine to wrapper --- lib/dataset.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/dataset.rb b/lib/dataset.rb index 95c1918..daa3470 100644 --- a/lib/dataset.rb +++ b/lib/dataset.rb @@ -454,6 +454,14 @@ module OpenTox end end + def value_map(prediction_feature_uri) + training_classes = accept_values(prediction_feature_uri).sort + value_map=Hash.new + training_classes.each_with_index { |c,i| value_map[i+1] = c } + value_map + end + + private # Copy a dataset (rewrites URI) def copy(dataset) @@ -504,6 +512,7 @@ module OpenTox @data_entries[compound.uri].collect{|f,v| @features[f] if f.match(/neighbor/)}.compact if @data_entries[compound.uri] end + # def errors(compound) # features = @data_entries[compound.uri].keys # features.collect{|f| @features[f][OT.error]}.join(" ") if features -- cgit v1.2.3