From 42e9f0f9a50372b3767c496436acad82340f8de7 Mon Sep 17 00:00:00 2001 From: gebele Date: Tue, 8 Aug 2017 14:51:28 +0000 Subject: fixes for batch and qmrf --- views/prediction.haml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'views/prediction.haml') diff --git a/views/prediction.haml b/views/prediction.haml index a657dba..9cdedde 100644 --- a/views/prediction.haml +++ b/views/prediction.haml @@ -23,7 +23,6 @@ = "#{@models[i].endpoint.gsub('_', ' ')} (#{@models[i].species})" / check for prediction - /- if prediction[:neighbors].size > 0 - if prediction[:neighbors] and !prediction[:value].nil? %p / show model type (classification|regression) @@ -43,7 +42,7 @@ - if prediction[:measurements].is_a?(Array) = (type == "Regression") ? prediction[:measurements].collect{|value| "#{value.delog10.signif(3)} (#{unit})
#{@compound.mmol_to_mg(value.delog10).signif(3)} #{unit =~ /mmol\/L/ ? "(mg/L)" : "(mg/kg_bw/day)"}"}.join("
") : prediction[:measurements].join(", ") - else - = (type == "Regression") ? "#{prediction[:measurements].delog10.signif(3)} (#{unit})
#{@compound.mmol_to_mg(prediction[:measurements].delog10).signif(3)} #{(unit =~ /\b(mol\/L)\b/) ? "(mg/L)" : "(mg/kg_bw/day)"}" : prediction[:measurements] + = (type == "Regression") ? "#{prediction[:measurements].delog10.signif(3)} (#{unit})
#{@compound.mmol_to_mg(prediction[:measurements].delog10).signif(3)} #{(unit =~ /\b(mmol\/L)\b/) ? "(mg/L)" : "(mg/kg_bw/day)"}" : prediction[:measurements] - else - @dbhit[i] = false @@ -54,7 +53,7 @@ / prediction popover %a.btn.glyphicon.glyphicon-info-sign{:href=>"javascript:void(0)", :title=>"Prediction", :tabindex=>"0", data: {trigger:"focus", toggle:"popover", placement:"left", html:"true", content:"

lazar searches the training dataset for similar compounds (neighbors) and calculates the prediction from their experimental activities.

Classification:
Majority vote of neighbor activities weighted by similarity.

Regression:
Prediction from a local partial least squares regression model with neighbor activities weighted by similarity.

Original publication.


\"DOI\""}} %br - = (type == "Regression") ? "#{prediction[:value].delog10.signif(3)} (#{unit})
#{@compound.mmol_to_mg(prediction[:value].delog10).signif(3)} #{(unit =~ /\b(mol\/L)\b/) ? "(mg/L)" : "(mg/kg_bw/day)"}" : prediction[:value] + = (type == "Regression") ? "#{prediction[:value].delog10.signif(3)} (#{unit})
#{@compound.mmol_to_mg(prediction[:value].delog10).signif(3)} #{(unit =~ /\b(mmol\/L)\b/) ? "(mg/L)" : "(mg/kg_bw/day)"}" : prediction[:value] / show prediction interval or probability %p @@ -66,7 +65,7 @@ %br = interval.nil? ? "--" : "#{interval[1].delog10.signif(3)} - #{interval[0].delog10.signif(3)} (#{unit})" %br - = "#{@compound.mmol_to_mg(interval[1].delog10).signif(3)} - #{@compound.mmol_to_mg(interval[0].delog10).signif(3)} #{(unit =~ /\b(mol\/L)\b/) ? "(mg/L)" : "(mg/kg_bw/day)"}" if !prediction[:prediction_interval].nil? + = "#{@compound.mmol_to_mg(interval[1].delog10).signif(3)} - #{@compound.mmol_to_mg(interval[0].delog10).signif(3)} #{(unit =~ /\b(mmol\/L)\b/) ? "(mg/L)" : "(mg/kg_bw/day)"}" if !interval.nil? - else %b Probability: / probability popover @@ -83,25 +82,24 @@ - if !prediction[:info].blank? %b Info: %br - %p=prediction[:info].sub(/excluded/, "excluded
") + %p=prediction[:info].sub(/\'.*\'/,"").sub(/,/, ",
") - if !prediction[:warnings].blank? %b Warnings: - prediction[:warnings].uniq.each do |warning| %br - %p=warning - %p=warning.sub(/substances/, "substances
").sub(/prediction\:/, "prediction\:
") + %p=warning.sub(/,/, ",
") + /%p=warning.sub(/substances/, "substances
").sub(/prediction\:/, "prediction\:
") - else %br - - @dbhit[i] = false - if !prediction[:info].blank? %b Info: %br - %p=prediction[:info].sub(/excluded/, "excluded
") + %p=prediction[:info].sub(/\'.*\'/,"").sub(/,/, ",
") - if !prediction[:warnings].blank? %b Warnings: - prediction[:warnings].uniq.each do |warning| %br - %p=warning.sub(/substances/, "substances
").sub(/prediction\:/, "prediction\:
") + %p=warning.sub(/,/, ",
") / always show the neighbors table, message is given there = haml :neighbors, :layout => false, :model_type => @model_types, :dbhit => @dbhit -- cgit v1.2.3