summaryrefslogtreecommitdiff
path: root/lib/model.rb
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2016-03-23 11:46:47 +0100
committerChristoph Helma <helma@in-silico.ch>2016-03-23 11:46:47 +0100
commit130524b0efa98f6e63d39c55e2f643130459ceee (patch)
treee0229ae7b99bd4cf074306ce34d1f5dd3daffc79 /lib/model.rb
parent6117375fdc800fd071fc4983896c26700bf2acd7 (diff)
prediction interval for regression
Diffstat (limited to 'lib/model.rb')
-rw-r--r--lib/model.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/model.rb b/lib/model.rb
index 5da5dc8..8e657b8 100644
--- a/lib/model.rb
+++ b/lib/model.rb
@@ -63,10 +63,11 @@ module OpenTox
end
neighbors.delete_if{|n| n['features'].empty? or n['features'][prediction_feature.id.to_s] == [nil] }
if neighbors.empty?
- prediction.merge!({:value => nil,:confidence => nil,:warning => "Could not find similar compounds with experimental data in the training dataset."})
+ prediction.merge!({:value => nil,:confidence => nil,:warning => "Could not find similar compounds with experimental data in the training dataset.",:neighbors => []})
else
prediction.merge!(Algorithm.run(prediction_algorithm, compound, {:neighbors => neighbors,:training_dataset_id=> training_dataset_id,:prediction_feature_id => prediction_feature.id}))
prediction[:neighbors] = neighbors
+ prediction[:neighbors] ||= []
end
prediction
end