From 3b7a80f1af7e8b68f2f8bc9fd137ec9be5658c20 Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Mon, 22 Aug 2011 11:09:28 +0000 Subject: integers in confusion matrix, average area under roc --- application.rb | 3 ++- views/classification_validation.haml | 12 ++++++------ views/model.haml | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/application.rb b/application.rb index 8ace27c..9eafcbe 100644 --- a/application.rb +++ b/application.rb @@ -319,7 +319,8 @@ post '/models' do # create a new model if validation.metadata[OT.classificationStatistics] @model.update(:correct_predictions => validation.metadata[OT.classificationStatistics][OT.percentCorrect].to_f) @model.update(:confusion_matrix => validation.confusion_matrix.to_yaml) - @model.update(:weighted_area_under_roc => validation.metadata[OT.classificationStatistics][OT.weightedAreaUnderRoc].to_f) + #@model.update(:weighted_area_under_roc => validation.metadata[OT.classificationStatistics][OT.weightedAreaUnderRoc].to_f) + @model.update(:weighted_area_under_roc => validation.metadata[OT.classificationStatistics][OT.averageAreaUnderRoc].to_f) validation.metadata[OT.classificationStatistics][OT.classValueStatistics].each do |m| if m[OT.classValue] =~ TRUE_REGEXP #HACK: estimate true feature value correctly diff --git a/views/classification_validation.haml b/views/classification_validation.haml index f25a321..dd2a7ae 100644 --- a/views/classification_validation.haml +++ b/views/classification_validation.haml @@ -3,7 +3,7 @@ = sprintf("%.2f", model.correct_predictions.to_f) if model.correct_predictions = '%' %dt - %a{:href => "http://en.wikipedia.org/wiki/Receiver_operating_characteristic", :rel => "external"} Weighted area under ROC: + %a{:href => "http://en.wikipedia.org/wiki/Receiver_operating_characteristic", :rel => "external"} Average area under ROC: %dd = sprintf("%.3f", model.weighted_area_under_roc.to_f) if model.weighted_area_under_roc %dt @@ -24,21 +24,21 @@ %tr - (1..cm[0].size-1).each do |i| %th{:bgcolor => "#CCD2DC"} - = cm[0][i] + = cm[0][i].to_i %tr %th{:rowspan => (cm.size - 1)} Predicted - (0..cm[1].size-1).each do |i| - if i == 0 %th{:bgcolor => "#CCD2DC"} - = cm[1][i] + = cm[1][i].to_i - else - %td= cm[1][i] + %td= cm[1][i].to_i - if cm.size > 2 - (2..cm.size-1).each do |i| %tr - (0..cm[i].size-1).each do |j| - if j == 0 %th{:bgcolor => "#CCD2DC"} - = cm[i][j] + = cm[i][j].to_i - else - %td= cm[i][j] + %td= cm[i][j].to_i diff --git a/views/model.haml b/views/model.haml index e688ae9..f0fd660 100644 --- a/views/model.haml +++ b/views/model.haml @@ -29,9 +29,9 @@ - if is_authorized(model.web_uri, "DELETE") %a{:href => url_for("/model/#{model.id}"), :id => "delete_#{model.id}", :class => 'delete_link'} - if model.status =~ /Completed|Error|Cancelled/ - (delete) +  (delete) - else - (stop) +  (stop) %span %br -- cgit v1.2.3 From 8656f259932b03c3ddf7f5eff755d70ab7fbe3eb Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Mon, 22 Aug 2011 12:54:35 +0000 Subject: confusion matrix class names fixed --- views/classification_validation.haml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/views/classification_validation.haml b/views/classification_validation.haml index 362a76f..47e1f75 100644 --- a/views/classification_validation.haml +++ b/views/classification_validation.haml @@ -24,13 +24,13 @@ %tr - (1..cm[0].size-1).each do |i| %th{:bgcolor => "#CCD2DC"} - = cm[0][i].to_i + = cm[0][i] %tr %th{:rowspan => (cm.size - 1)} Predicted - (0..cm[1].size-1).each do |i| - if i == 0 %th{:bgcolor => "#CCD2DC"} - = cm[1][i].to_i + = cm[1][i] - else %td= cm[1][i].to_i - if cm.size > 2 @@ -39,6 +39,6 @@ - (0..cm[i].size-1).each do |j| - if j == 0 %th{:bgcolor => "#CCD2DC"} - = cm[i][j].to_i + = cm[i][j] - else %td= cm[i][j].to_i -- cgit v1.2.3