From 282ca3f261897df3324ecdf7040d1a7b1c37edd9 Mon Sep 17 00:00:00 2001 From: mguetlein Date: Thu, 18 Aug 2011 10:47:06 +0200 Subject: replace weighted_auc with average_auc --- model.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model.rb b/model.rb index e433893..bab5bde 100644 --- a/model.rb +++ b/model.rb @@ -31,7 +31,7 @@ class ToxCreateModel < Ohm::Model attribute :nr_compounds attribute :nr_predictions attribute :correct_predictions - attribute :weighted_area_under_roc + attribute :average_area_under_roc attribute :sensitivity attribute :specificity attribute :r_square -- cgit v1.2.3 From b41552185b21f706e7f507020925f3253c38321d Mon Sep 17 00:00:00 2001 From: mguetlein Date: Mon, 22 Aug 2011 11:25:06 +0200 Subject: unify cookies --- application.rb | 5 +++-- helper.rb | 30 ------------------------------ 2 files changed, 3 insertions(+), 32 deletions(-) diff --git a/application.rb b/application.rb index a60e597..ac19da5 100644 --- a/application.rb +++ b/application.rb @@ -9,8 +9,9 @@ require 'ftools' require File.join(File.dirname(__FILE__),'model.rb') require File.join(File.dirname(__FILE__),'helper.rb') -use Rack::Session::Cookie, :expire_after => 28800, - :secret => "ui6vaiNi-change_me" +#moved to wrapper->environment +#use Rack::Session::Cookie, :expire_after => 28800, +# :secret => "ui6vaiNi-change_me" use Rack::Flash set :lock, true diff --git a/helper.rb b/helper.rb index 698fd3e..80707c3 100644 --- a/helper.rb +++ b/helper.rb @@ -1,35 +1,5 @@ helpers do - def login(username, password) - logout - session[:subjectid] = OpenTox::Authorization.authenticate(username, password) - #LOGGER.debug "ToxCreate login user #{username} with subjectid: " + session[:subjectid].to_s - if session[:subjectid] != nil - session[:username] = username - return true - else - session[:username] = "" - return false - end - end - - def logout - if session[:subjectid] != nil - session[:subjectid] = nil - session[:username] = "" - return true - end - return false - end - - def logged_in() - return true if !AA_SERVER - if session[:subjectid] != nil - return OpenTox::Authorization.is_token_valid(session[:subjectid]) - end - return false - end - def is_authorized(uri, action) if OpenTox::Authorization.server && session[:subjectid] != nil return OpenTox::Authorization.authorized?(uri, action, session[:subjectid]) -- cgit v1.2.3 From a4b6e68acf76949a1765177b6d5b8c454990cb8a Mon Sep 17 00:00:00 2001 From: mguetlein Date: Mon, 22 Aug 2011 12:20:12 +0200 Subject: replace weighted_auc with average_auc [2] --- application.rb | 2 +- views/classification_validation.haml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/application.rb b/application.rb index d2ee131..eb86916 100644 --- a/application.rb +++ b/application.rb @@ -320,7 +320,7 @@ 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(:average_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..9f5c2c9 100644 --- a/views/classification_validation.haml +++ b/views/classification_validation.haml @@ -3,9 +3,9 @@ = 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 + = sprintf("%.3f", model.average_area_under_roc.to_f) if model.average_area_under_roc %dt %a{:href => "http://en.wikipedia.org/wiki/Sensitivity_and_specificity", :rel => "external"} Specificity: %dd= sprintf("%.3f", model.specificity.to_f) if model.specificity -- cgit v1.2.3