summaryrefslogtreecommitdiff
path: root/lib/ot_predictions.rb
diff options
context:
space:
mode:
authorMartin Gütlein <martin.guetlein@gmail.com>2010-03-30 16:49:46 +0200
committerMartin Gütlein <martin.guetlein@gmail.com>2010-03-30 16:49:46 +0200
commit1a9419d158ede2535ae10b84d044da6a2cf89cfa (patch)
tree885b03c9018e78d61bf497bda8addc925d2857ae /lib/ot_predictions.rb
parentae0b071c42c37ea974aa234f30a3a8cb77aa7eb3 (diff)
mostly munich changes
Diffstat (limited to 'lib/ot_predictions.rb')
-rw-r--r--lib/ot_predictions.rb35
1 files changed, 20 insertions, 15 deletions
diff --git a/lib/ot_predictions.rb b/lib/ot_predictions.rb
index 6e9c7a2..9e6f5c9 100644
--- a/lib/ot_predictions.rb
+++ b/lib/ot_predictions.rb
@@ -22,29 +22,21 @@ module Lib
"', prediction_feature: '"+prediction_feature.to_s+"' "+
"', predicted_variable: '"+predicted_variable.to_s+"'")
+ if prediction_feature =~ /ambit.uni-plovdiv.bg.*feature.*264185/
+ LOGGER.warn "HACK for report example"
+ prediction_feature = "http://ambit.uni-plovdiv.bg:8080/ambit2/feature/264187"
+ end
+
predicted_variable=prediction_feature if predicted_variable==nil
test_dataset = OpenTox::Dataset.find test_dataset_uri
- prediction_dataset = OpenTox::Dataset.find prediction_dataset_uri
raise "test dataset not found: '"+test_dataset_uri.to_s+"'" unless test_dataset
- raise "prediction dataset not found: '"+prediction_dataset_uri.to_s+"'" unless prediction_dataset
- raise "test dataset feature not found: '"+prediction_feature+"', available features: "+test_dataset.features.inspect if test_dataset.features.index(prediction_feature)==nil
- raise "prediction dataset feature not found: '"+predicted_variable+"', available features: "+prediction_dataset.features.inspect if prediction_dataset.features.index(predicted_variable)==nil
-
- class_values = OpenTox::Feature.domain(prediction_feature)
+ raise "test dataset feature not found: '"+prediction_feature.to_s+"', available features: "+test_dataset.features.inspect if test_dataset.features.index(prediction_feature)==nil
@compounds = test_dataset.compounds
LOGGER.debug "test dataset size: "+@compounds.size.to_s
raise "test dataset is empty" unless @compounds.size>0
- raise "more predicted than test compounds test:"+@compounds.size.to_s+" < prediction:"+
- prediction_dataset.compounds.size.to_s if @compounds.size < prediction_dataset.compounds.size
-
- if CHECK_VALUES
- prediction_dataset.compounds.each do |c|
- raise "predicted compound not found in test dataset:\n"+c+"\ntest-compounds:\n"+
- @compounds.collect{|c| c.to_s}.join("\n") if @compounds.index(c)==nil
- end
- end
+ class_values = OpenTox::Feature.domain(prediction_feature)
actual_values = []
@compounds.each do |c|
@@ -67,6 +59,19 @@ module Lib
end
end
+ prediction_dataset = OpenTox::Dataset.find prediction_dataset_uri
+ raise "prediction dataset not found: '"+prediction_dataset_uri.to_s+"'" unless prediction_dataset
+ raise "prediction dataset feature not found: '"+predicted_variable+"', available features: "+prediction_dataset.features.inspect if prediction_dataset.features.index(predicted_variable)==nil
+
+ raise "more predicted than test compounds test:"+@compounds.size.to_s+" < prediction:"+
+ prediction_dataset.compounds.size.to_s if @compounds.size < prediction_dataset.compounds.size
+ if CHECK_VALUES
+ prediction_dataset.compounds.each do |c|
+ raise "predicted compound not found in test dataset:\n"+c+"\ntest-compounds:\n"+
+ @compounds.collect{|c| c.to_s}.join("\n") if @compounds.index(c)==nil
+ end
+ end
+
predicted_values = []
confidence_values = []
@compounds.each do |c|