From c90644211e214a50f6fdb3a936bf247f45f1f4be Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Fri, 13 May 2016 13:38:24 +0200 Subject: compound tests fixed --- lib/validation.rb | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'lib/validation.rb') diff --git a/lib/validation.rb b/lib/validation.rb index 015e718..9122df1 100644 --- a/lib/validation.rb +++ b/lib/validation.rb @@ -32,20 +32,14 @@ module OpenTox predictions = validation_model.predict test_set.substances predictions.each{|cid,p| p.delete(:neighbors)} nr_unpredicted = 0 - p predictions.size predictions.each do |cid,prediction| - p prediction if prediction[:value] - tox = Substance.find(cid).toxicities[prediction[:prediction_feature_id].to_s] - p tox - #prediction[:measured] = Substance.find(cid).toxicities[prediction[:prediction_feature_id].to_s][test_set.id.to_s] - prediction[:measured] = tox[test_set.id.to_s] if tox + prediction[:measured] = test_set.values(cid, prediction[:prediction_feature_id]) else nr_unpredicted += 1 end - predictions.delete(cid) unless prediction[:value] and prediction[:measured] end - p predictions.size + predictions.select!{|cid,p| p[:value] and p[:measured]} validation = self.new( :model_id => validation_model.id, :test_dataset_id => test_set.id, -- cgit v1.2.3