summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Maunz <andreas@maunz.de>2012-04-10 14:05:12 +0200
committerAndreas Maunz <andreas@maunz.de>2012-04-10 14:05:12 +0200
commitcab2c3249e729cc9c6be3a4a306b05d60f8f9f2e (patch)
tree56258c8994cf59158aac51588782cfdb4de75454
parent9654d5446cf40b4dd6deb00131c5444f44711f7b (diff)
Added common value_map routine to wrapper
-rw-r--r--lib/dataset.rb9
1 files changed, 9 insertions, 0 deletions
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