:javascript $(document).ready(function(){ $('[data-toggle="popover"]').popover(); $('.modal').on('hidden.bs.modal', function () { $(this).removeData('bs.modal'); }); $('.modal').on('show.bs.modal', function(e){ var button = $(e.relatedTarget); var modal = $(this); modal.find('.modal-content').load(button.data("remote")); }); }); %div.card %a.btn.btn-outline-info{:href => to('/predict')} %span.fa.fa-caret-left New Prediction %div.card.bg-light %div.card-body %h3.card-title Prediction: %div.table-responsive %table.table.table-bordered{:id=>"overview"} %tbody %tr %td.align-items-center{:id=>"compound"} %a.btn.btn-link{:href => "#details0", data: { toggle: "modal", remote: to("/prediction/#{@compound.id}/details"), :id=>"link01"}} = embedded_svg(@compound.svg, :title=>"click for details") %p= @compound.smiles %p %a{:href=>PUBCHEM_CID_URI+@compound.cid, :rel => "external"} PubChem %span.fa.fa-xs.fa-external-link - @model_types = {} - @dbhit = {} - @predictions.each_with_index do |prediction,i| - type = @models[i].model.class.to_s.match("Classification") ? "Classification" : "Regression" - @model_types[i] = type - unit = @models[i].unit %td %b{:class => "title"} = "#{@models[i].endpoint.gsub('_', ' ')} (#{@models[i].species})" / check for prediction - if prediction[:neighbors] and !prediction[:value].nil? %p / show model type (classification|regression) %b Type: = type %p / check for database hit - if prediction[:info] =~ /\b(identical)\b/i - @dbhit[i] = true / show message about dbhit and measurements %p :plain This compound was part of the training dataset. All information from this compound was removed from the training data before the prediction, to obtain unbiased results. %p %b Measured activity: %br - 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(mmol\/L)\b/) ? "(mg/L)" : "(mg/kg_bw/day)"}" : prediction[:measurements] - else - @dbhit[i] = false / show prediction %p %b Prediction: / prediction popover %a.btn.fa.fa-info-circle{: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.