diff options
author | mr <mr@mrautenberg.de> | 2010-05-14 11:00:13 +0200 |
---|---|---|
committer | mr <mr@mrautenberg.de> | 2010-05-14 11:00:13 +0200 |
commit | 5393c1d8cf40bc4a719000837f189e10711b1776 (patch) | |
tree | 56ab13af5a858f6edaa8830c9616e47ef6db5dd1 /views/model.haml | |
parent | e751e915dea86741901c806da661045e617ae9e1 (diff) | |
parent | 372dcccbb935db0614df71e5733f16373ad2d481 (diff) |
merge helma new master branch
Diffstat (limited to 'views/model.haml')
-rw-r--r-- | views/model.haml | 72 |
1 files changed, 59 insertions, 13 deletions
diff --git a/views/model.haml b/views/model.haml index 25513aa..affc25a 100644 --- a/views/model.haml +++ b/views/model.haml @@ -30,11 +30,7 @@ - if model.status == 'completed' %dt Algorithm: %dd - - begin - %a{:href => model.algorithm} #{File.basename model.algorithm} - - rescue - %b - - + %a{:href => model.algorithm} #{File.basename model.algorithm} %dt Descriptors: %dd %a{:href => 'http://www.maunz.de/libfminer2-bbrc-doc/'} Fminer backbone refinement classes @@ -60,18 +56,68 @@ %a{:href => "#{model.uri}.yaml"} YAML %em (more formats to be added) %dt Validation: + - if model.validation_report_uri + %a{:href => model.validation_report_uri, :target => "_blank"} (more details) %dd - %em temporarily disabled - -# if model.validation_uri + - if model.validation_uri - uri = File.join(model.validation_uri, 'statistics') - - yaml = RestClient.get(uri).to_s + - yaml = RestClient.get(uri).body - v = YAML.load(yaml) + - tp=0; tn=0; fp=0; fn=0; n=0 + - v[:classification_statistics][:confusion_matrix][:confusion_matrix_cell].each do |cell| + - if cell[:confusion_matrix_predicted] == "true" and cell[:confusion_matrix_actual] == "true" + - tp = cell[:confusion_matrix_value] + - n += tp + - elsif cell[:confusion_matrix_predicted] == "false" and cell[:confusion_matrix_actual] == "false" + - tn = cell[:confusion_matrix_value] + - n += tn + - elsif cell[:confusion_matrix_predicted] == "false" and cell[:confusion_matrix_actual] == "true" + - fn = cell[:confusion_matrix_value] + - n += fn + - elsif cell[:confusion_matrix_predicted] == "true" and cell[:confusion_matrix_actual] == "false" + - fp = cell[:confusion_matrix_value] + - n += fp + + + -#%pre + = yaml %dl + %dt Number of predictions: + %dd= n %dt Correct predictions: %dd - = v[:classification_statistics][:percent_correct].to_s + =# sprintf("%.2f", v[:classification_statistics][:percent_correct].to_f) + = sprintf("%.2f", 100*(tp+tn).to_f/n) = '%' - -# else - %em under construction - = image_tag("/snake_transparent.gif") - =# model.validation_task_uri + %dt + %a{:href => "http://en.wikipedia.org/wiki/Receiver_operating_characteristic", :target => "_blank"} Weighted area under ROC: + %dd + = sprintf("%.3f", v[:classification_statistics][:weighted_area_under_roc].to_f) + %dt + %a{:href => "http://en.wikipedia.org/wiki/Sensitivity_and_specificity", :target => "_blank"} Specificity: + %dd= sprintf("%.3f", tn.to_f/(tn+fp)) + %dt + %a{:href => "http://en.wikipedia.org/wiki/Sensitivity_and_specificity", :target => "_blank"} Sensitivity: + %dd= sprintf("%.3f", tp.to_f/(tp+fn)) + %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= tp + %td= fp + %tr + %th inactive + %td= fn + %td= tn + - else + = image_tag("/snake_transparent.gif") if model.validation_status == "Running" + %a{:href => model.validation_task_uri} #{model.validation_status}
\ No newline at end of file |