summaryrefslogtreecommitdiff
path: root/views/prediction.haml
diff options
context:
space:
mode:
Diffstat (limited to 'views/prediction.haml')
-rw-r--r--views/prediction.haml50
1 files changed, 50 insertions, 0 deletions
diff --git a/views/prediction.haml b/views/prediction.haml
new file mode 100644
index 0000000..8498abc
--- /dev/null
+++ b/views/prediction.haml
@@ -0,0 +1,50 @@
+%p
+ = link_to "New prediction", "/predict"
+.predictions
+ %table
+ %tr
+ %th{:colspan => @predictions.size+1}
+ = @identifier
+ %tr
+ %td
+ %img{:src => @compound.to_image_uri, :alt => @compound.to_smiles}
+ - @predictions.each do |p|
+ - LOGGER.debug p.to_yaml
+ %td
+ %b
+ = p[:title] + ":"
+ - if p[:measured_activities]
+ %br
+ - p[:measured_activities].each do |a|
+ = activity_markup(a)
+ %br
+ (
+ %a{:href => "#", :id => "linkTrainingData#{p.object_id}"} Measured activity
+ :javascript
+ $("a#linkTrainingData#{p.object_id}").click(function () {
+ $("dl#training_data").toggle();
+ });
+ )
+
+ - elsif p[:error]
+ %br= p[:error]
+ - else
+ = activity_markup(p[:prediction])
+ - if p[:confidence]
+ %br
+ (
+ %a{:href => "#", :id => "linkConfidence#{p.object_id}"} Confidence
+ = ": #{sprintf('%.03g', p[:confidence].to_f.abs)}"
+ :javascript
+ $("a#linkConfidence#{p.object_id}").click(function () {
+ $("dl#confidence").toggle();
+ });
+ )
+ %br
+ %form{:name => "form", :action => url_for('/lazar'), :method => "post", :enctype => "multipart/form-data" }
+ %input{:type => :hidden, :name => :compound_uri, :value => @compound.uri}
+ %input{:type => :hidden, :name => :model_uri, :value => p[:model_uri]}
+ %input{ :type => "submit", :value => "Details"}
+
+= haml :confidence, :layout => false
+= haml :training_data, :layout => false