%div.well %a.btn.btn-warning{:href => to('/predict')} %span.glyphicon.glyphicon-menu-left{:aria=>{:hidden=>"true"}} New Prediction / displays all prediction result in first table %div.table-responsive %table.table.table-bordered{:id=>"batch", :style=>"background-color:white;"} %thead %tr %h3.col-md-4{:style=>"padding-left:0;"} Batch Prediction Results: %h3.col-md-8= @filename %tr %span.btn.btn-default %a{:href=>"#{to("/predict/#{@filename}")}", :title=>"download"} %span.glyphicon.glyphicon-download-alt{:aria=>{:hidden=>"true"}} CSV %tbody / key = compound, values = array of arrays with model, prediction - @batch.each do |key, values| - compound = key - mw = compound.molecular_weight %tr %td{:style=>"vertical-align:top;"} %p= compound.svg %p= compound.smiles / array = single prediction [endpoint, result] - values.each_with_index do |array,i| %td{:style=>"vertical-align:top;white-space:nowrap;"} - model = array[0] - prediction = array[1] %b{:class => "title"} = "#{model.endpoint.gsub('_', ' ')} (#{model.species})" %p - if prediction[:confidence] == "measured" %p %b Measured activity: - if prediction[:value].is_a?(Array) = prediction[:value][0].numeric? ? prediction[:value].collect{|v| weight = compound.mmol_to_mg(v, mw); '%.2e' % v + " (#{model.unit})"+" | #{'%.2e' % weight} (mg/kg_bw/day)"}.join("
") : prediction[:value].join(", ") - else = prediction[:value].numeric? ? "#{'%.2e' % prediction[:value]} (#{model.unit}) | #{'%.2e' % compound.mmol_to_mg(prediction[:value], mw)} (mg/kg_bw/day)" : prediction[:value] %p %b Compound is part of the training dataset - elsif prediction[:neighbors].size > 0 %p / model type (classification|regression) %b Type: = model.model.class.to_s.match("Classification") ? "Classification" : "Regression" %br %b Prediction: = prediction[:value].numeric? ? "#{'%.2e' % prediction[:value]} (#{model.unit}) | #{'%.2e' % compound.mmol_to_mg(prediction[:value], mw)} (mg/kg_bw/day)" : prediction[:value] %br / TODO probability %b Confidence: = prediction[:confidence].round(3) %p - else %p = "Not enough similar compounds
in training dataset."