From abc3526e318a2bfa24dfe033d8879e7657c2ae5c Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Tue, 15 Mar 2016 18:46:34 +0100 Subject: single tests pass --- lib/model.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/model.rb') diff --git a/lib/model.rb b/lib/model.rb index f21ea54..5da5dc8 100644 --- a/lib/model.rb +++ b/lib/model.rb @@ -66,6 +66,7 @@ module OpenTox prediction.merge!({:value => nil,:confidence => nil,:warning => "Could not find similar compounds with experimental data in the training dataset."}) 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 end prediction end @@ -95,7 +96,7 @@ module OpenTox case object.class.to_s when "OpenTox::Compound" prediction = predictions.first - prediction[:neighbors] = neighbors.sort{|a,b| b[1] <=> a[1]} # sort according to similarity + prediction[:neighbors].sort!{|a,b| b[1] <=> a[1]} # sort according to similarity return prediction when "Array" return predictions -- cgit v1.2.3