summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpublic/javascripts/toxcreate.js11
-rw-r--r--views/model.haml51
-rw-r--r--views/model_validation.haml50
-rwxr-xr-xviews/models.haml2
4 files changed, 64 insertions, 50 deletions
diff --git a/public/javascripts/toxcreate.js b/public/javascripts/toxcreate.js
index 47fab03..f2523b3 100755
--- a/public/javascripts/toxcreate.js
+++ b/public/javascripts/toxcreate.js
@@ -76,7 +76,16 @@ $(function() {
return false;
};
-
+ checkValidation = function() {
+ var reload_id = "";
+ $("input.model_validation").each(function(){
+ if($(this).val() != "Completed") {
+ reload_id = this.id.replace("model_validation_","");
+ if(/^\d+$/.test(reload_id)) loadModel(reload_id);
+ };
+ });
+ var validationCheck = setTimeout('checkValidation()',15000);
+ }
});
jQuery.fn.deleteModel = function(type, options) {
diff --git a/views/model.haml b/views/model.haml
index b255e80..dc003f6 100644
--- a/views/model.haml
+++ b/views/model.haml
@@ -54,52 +54,5 @@
,
%a{:href => "#{model.uri}.yaml"} YAML
%em (experts, models cannot be exported in Excel)
- %dt
- Validation:
- - if model.validation_report_uri
- %a{:href => model.validation_report_uri, :target => "_blank"} (more details)
- %dd
- - if model.validation_uri
- - v = model.validation
- - if v == "Service not available"
- = v
- - else
- %dl
- %dt Number of predictions:
- %dd= v[:n]
- %dt Correct predictions:
- %dd
- = v[:correct_predictions]
- = '%'
- %dt
- %a{:href => "http://en.wikipedia.org/wiki/Receiver_operating_characteristic", :target => "_blank"} Weighted area under ROC:
- %dd
- = v[:weighted_area_under_roc]
- %dt
- %a{:href => "http://en.wikipedia.org/wiki/Sensitivity_and_specificity", :target => "_blank"} Specificity:
- %dd= v[:specificity]
- %dt
- %a{:href => "http://en.wikipedia.org/wiki/Sensitivity_and_specificity", :target => "_blank"} Sensitivity:
- %dd= v[:sensitivity]
- %dt
- %a{:href => "http://en.wikipedia.org/wiki/Confusion_matrix", :target => "_blank"} Confusion Matrix:
- %dd
- %table
- %tr
- %th
- %th Measured
- %tr
- %th Predicted
- %th active
- %th inactive
- %tr
- %th active
- %td= v[:tp]
- %td= v[:fp]
- %tr
- %th inactive
- %td= v[:fn]
- %td= v[:tn]
- - else
- = image_tag("/snake_transparent.gif") if model.validation_status == "Running"
- %a{:href => model.validation_task_uri} #{model.validation_status}
+ = haml :model_validation, :locals=>{:model=>model}, :layout => false
+ \ No newline at end of file
diff --git a/views/model_validation.haml b/views/model_validation.haml
new file mode 100644
index 0000000..a9472ee
--- /dev/null
+++ b/views/model_validation.haml
@@ -0,0 +1,50 @@
+%dt
+ Validation:
+ %input{ :id => "model_validation_#{model.id}", :type => "hidden", :value => "#{model.validation_status}", :class => "model_validation" }
+ - if model.validation_report_uri
+ %a{:href => model.validation_report_uri, :target => "_blank"} (more details)
+%dd
+ - if model.validation_uri
+ - v = model.validation
+ - if v == "Service not available"
+ = v
+ - else
+ %dl
+ %dt Number of predictions:
+ %dd= v[:n]
+ %dt Correct predictions:
+ %dd
+ = v[:correct_predictions]
+ = '%'
+ %dt
+ %a{:href => "http://en.wikipedia.org/wiki/Receiver_operating_characteristic", :target => "_blank"} Weighted area under ROC:
+ %dd
+ = v[:weighted_area_under_roc]
+ %dt
+ %a{:href => "http://en.wikipedia.org/wiki/Sensitivity_and_specificity", :target => "_blank"} Specificity:
+ %dd= v[:specificity]
+ %dt
+ %a{:href => "http://en.wikipedia.org/wiki/Sensitivity_and_specificity", :target => "_blank"} Sensitivity:
+ %dd= v[:sensitivity]
+ %dt
+ %a{:href => "http://en.wikipedia.org/wiki/Confusion_matrix", :target => "_blank"} Confusion Matrix:
+ %dd
+ %table
+ %tr
+ %th
+ %th Measured
+ %tr
+ %th Predicted
+ %th active
+ %th inactive
+ %tr
+ %th active
+ %td= v[:tp]
+ %td= v[:fp]
+ %tr
+ %th inactive
+ %td= v[:fn]
+ %td= v[:tn]
+ - else
+ = image_tag("/snake_transparent.gif") if model.validation_status == "Running"
+ %a{:href => model.validation_task_uri} #{model.validation_status}
diff --git a/views/models.haml b/views/models.haml
index c11aaa7..806a935 100755
--- a/views/models.haml
+++ b/views/models.haml
@@ -5,6 +5,8 @@
if(#{stati != 0}) {
setTimeout('checkStati("#{stati_to_check}")',1500);
}
+ var reload_validation = true;
+ if(reload_validation) setTimeout('checkValidation()',15000);
});
%p Get an overview about ToxCreate models. This page is refreshed every 15 seconds to update the model status.