summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2011-08-22 11:09:28 +0000
committerChristoph Helma <helma@in-silico.ch>2011-08-22 11:09:28 +0000
commit3b7a80f1af7e8b68f2f8bc9fd137ec9be5658c20 (patch)
treef4e35124277de544c7d7243af1a14ef85d3deb92
parent12b3295738445c941b03b15c34ec9e7f2fb56816 (diff)
integers in confusion matrix, average area under roc
-rw-r--r--application.rb3
-rw-r--r--views/classification_validation.haml12
-rw-r--r--views/model.haml4
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)
+ &nbsp;(delete)
- else
- (stop)
+ &nbsp;(stop)
%span
%br