summaryrefslogtreecommitdiff
path: root/lib/model.rb
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2019-06-20 22:01:50 +0200
committerChristoph Helma <helma@in-silico.ch>2019-06-20 22:01:50 +0200
commit455da06aa6459da0d25b286ca6cb866ff64c4c34 (patch)
treed0ed8fcf720a02742da781669251f379b8fd07f0 /lib/model.rb
parent1b44e0cd76f2ead93b8b3fa0f970c85ef32a4b14 (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.rb8
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