diff options
author | Christoph Helma <helma@in-silico.ch> | 2019-06-20 22:01:50 +0200 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2019-06-20 22:01:50 +0200 |
commit | 455da06aa6459da0d25b286ca6cb866ff64c4c34 (patch) | |
tree | d0ed8fcf720a02742da781669251f379b8fd07f0 /lib/model.rb | |
parent | 1b44e0cd76f2ead93b8b3fa0f970c85ef32a4b14 (diff) |
separate csv serialisations for batch predictions and training data, repeated measurements in mutagenicity dataset fixed, daphnia import fixed, CENTRAL_MONGO_IP removed
Diffstat (limited to 'lib/model.rb')
-rw-r--r-- | lib/model.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/model.rb b/lib/model.rb index cbfefe3..05cd113 100644 --- a/lib/model.rb +++ b/lib/model.rb @@ -286,14 +286,14 @@ module OpenTox end if threshold == algorithms[:similarity][:min].first if prediction[:warnings].empty? - prediction[:confidence] = "High (close to bioassay results)" + prediction[:confidence] = "Similar to bioassay results" return prediction else # try again with a lower threshold prediction[:warnings] << "Lowering similarity threshold to #{algorithms[:similarity][:min].last}." predict_substance substance, algorithms[:similarity][:min].last, prediction end elsif threshold < algorithms[:similarity][:min].first - prediction[:confidence] = "Low (lower than bioassay results)" + prediction[:confidence] = "Lower than bioassay results" return prediction end end @@ -348,9 +348,9 @@ module OpenTox end elsif prediction_feature.is_a? NumericBioActivity f = NumericLazarPrediction.find_or_create_by(:name => prediction_feature.name, :unit => prediction_feature.unit, :model_id => self.id, :training_feature_id => prediction_feature.id) - prediction_interval = {} + prediction_interval = [] ["lower","upper"].each do |v| - prediction_interval[v] = LazarPredictionInterval.find_or_create_by(:name => v, :model_id => self.id, :training_feature_id => prediction_feature.id) + prediction_interval << LazarPredictionInterval.find_or_create_by(:name => v, :model_id => self.id, :training_feature_id => prediction_feature.id) end end |