summaryrefslogtreecommitdiff
path: root/lib/ot_predictions.rb
diff options
context:
space:
mode:
authormguetlein <martin.guetlein@gmail.com>2010-11-26 16:05:25 +0100
committermguetlein <martin.guetlein@gmail.com>2010-11-26 16:05:25 +0100
commit16a25a63ba7882901a778745d0a32baaafc22cad (patch)
tree9bf89ee176575aa49da36a4bc57e8c09a75fad4a /lib/ot_predictions.rb
parenta6d79dffc5f65300f06f3a33451ef26d0fb96f08 (diff)
huge commit, main changes: validation_type and .finished introduced, supporting subtasks, reporting slightly refactored
Diffstat (limited to 'lib/ot_predictions.rb')
-rw-r--r--lib/ot_predictions.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/ot_predictions.rb b/lib/ot_predictions.rb
index dcd7d09..0175a0c 100644
--- a/lib/ot_predictions.rb
+++ b/lib/ot_predictions.rb
@@ -15,7 +15,8 @@ module Lib
return @compounds[instance_index]
end
- def initialize(is_classification, test_dataset_uri, test_target_dataset_uri, prediction_feature, prediction_dataset_uri, predicted_variable)
+ def initialize(is_classification, test_dataset_uri, test_target_dataset_uri,
+ prediction_feature, prediction_dataset_uri, predicted_variable, task=nil)
LOGGER.debug("loading prediciton via test-dataset:'"+test_dataset_uri.to_s+
"', test-target-datset:'"+test_target_dataset_uri.to_s+
@@ -79,6 +80,7 @@ module Lib
actual_values.push value
end
end
+ task.progress(40) if task # loaded actual values
prediction_dataset = OpenTox::Dataset.find prediction_dataset_uri
raise "prediction dataset not found: '"+prediction_dataset_uri.to_s+"'" unless prediction_dataset
@@ -118,9 +120,11 @@ module Lib
confidence_values << prediction_dataset.get_prediction_confidence(c, predicted_variable)
end
end
+ task.progress(80) if task # loaded predicted values and confidence
super(predicted_values, actual_values, confidence_values, is_classification, class_values)
raise "illegal num compounds "+num_info if @compounds.size != @predicted_values.size
+ task.progress(100) if task # done with the mathmatics
end
@@ -128,7 +132,7 @@ module Lib
res = {}
if @is_classification
- (Lib::VAL_CLASS_PROPS_EXTENDED).each{ |s| res[s] = send(s)}
+ (Lib::VAL_CLASS_PROPS).each{ |s| res[s] = send(s)}
else
(Lib::VAL_REGR_PROPS).each{ |s| res[s] = send(s) }
end
@@ -151,7 +155,8 @@ module Lib
a.push( "http://ambit.uni-plovdiv.bg:8080/ambit2/depict/cdk?search="+
URI.encode(OpenTox::Compound.new(:uri=>p.identifier(i)).smiles) ) if add_pic
rescue => ex
- a.push("Could not add pic: "+ex.message)
+ #a.push("Could not add pic: "+ex.message)
+ a.push(p.identifier(i))
end
a << (format ? p.actual_value(i).to_nice_s : p.actual_value(i))