summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgebele <gebele@in-silico.ch>2017-10-20 12:59:14 +0000
committergebele <gebele@in-silico.ch>2017-10-20 12:59:14 +0000
commitc9c59232e08e3a654c7c630820e65f6c86dc20cc (patch)
tree9ddc356e890b3e7d06bc9efc2059b0ce30b32533
parenta1e050bb6b4b4ddd37881daa74d7f12dccce0b0f (diff)
removed loggers;go for string only in sa
-rw-r--r--application.rb6
1 files changed, 1 insertions, 5 deletions
diff --git a/application.rb b/application.rb
index dc46bf7..161509b 100644
--- a/application.rb
+++ b/application.rb
@@ -192,7 +192,7 @@ get '/batch/:model/' do
confidence = ( 1 - sa_prediction[:error_product] ) - 0.57
end
output['sa_prediction'] = sa_prediction
- output['sa_matches'] = sa_prediction[:matches].flatten unless sa_prediction[:matches].blank?
+ output['sa_matches'] = sa_prediction[:matches].flatten.first unless sa_prediction[:matches].blank?
output['confidence'] = confidence.signif(3)
output['model_name'] = "Lazar #{model.endpoint.gsub('_', ' ').downcase} (#{model.species}):"
output['probability'] = prediction[:probabilities] ? prediction[:probabilities].collect{|k,v| "#{k}: #{v.signif(3)}"} : false
@@ -258,9 +258,7 @@ post '/predict/?' do
$logger.debug "save dataset #{params[:fileselect][:filename]}"
if input.class == OpenTox::Dataset
@dataset = Dataset.find input
- $logger.debug "get compounds"
@compounds = @dataset.compounds
- $logger.debug "get compounds finish"
else
bad_request_error "Could not serialize file '#{@filename}'."
end
@@ -276,7 +274,6 @@ post '/predict/?' do
@models = params[:selection].keys
@tmppaths = {}
- $logger.debug "get endpoint"
@models.each do |model|
m = Model::Validation.find model
type = (m.regression? ? "Regression" : "Classification") unless model == "Cramer"
@@ -300,7 +297,6 @@ post '/predict/?' do
File.open(path, "w"){|f| f.write(header) if header}
@tmppaths[model] = path.split("/").last
end
- $logger.debug "get endpoint finished"
File.delete File.join("tmp", params[:fileselect][:filename])
return haml :batch