diff options
author | mr <mr@mrautenberg.de> | 2011-09-23 12:22:40 +0200 |
---|---|---|
committer | mr <mr@mrautenberg.de> | 2011-09-23 12:22:40 +0200 |
commit | 41b1e72eba222a337efa70e61734b34118f832c6 (patch) | |
tree | 15645033d7cf516f9c19cc11ec9d16bbdba43327 /report/report_application.rb | |
parent | b076615734eb9a51a29e3dc01e0c96d86e5c75c9 (diff) | |
parent | 9db1f68871ad3e9be92744fd908f9fee9eeb18a0 (diff) |
Merge branch 'release/v3.0.0'v3.0.0
Diffstat (limited to 'report/report_application.rb')
-rwxr-xr-x | report/report_application.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/report/report_application.rb b/report/report_application.rb index b96fb27..5fec6d1 100755 --- a/report/report_application.rb +++ b/report/report_application.rb @@ -50,6 +50,10 @@ get '/report/?' do end end +def wrap(s, width=78) + s.gsub(/(.{1,#{width}})(\s+|\Z)/, "\\1\n") +end + get '/report/:report_type' do perform do |rs| case request.env['HTTP_ACCEPT'].to_s @@ -60,8 +64,15 @@ get '/report/:report_type' do "Crossvalidations: "+url_for("/crossvalidation",:full) description = "A list of all "+params[:report_type]+" reports. To create a report, use the POST method." + if params[:report_type]=="algorithm_comparison" + description += "\n\nThis report can be used to compare the validation results of different algorithms that have been validated on the same dataset." + description += "\nThe following attributes can be compared with the t-test:" + description += "\n\n* All validation types:\n"+wrap((Validation::VAL_PROPS_SUM+Validation::VAL_PROPS_AVG).join(", "),120) + description += "\n* Classification validations:\n"+wrap(Validation::VAL_CLASS_PROPS.join(", "),120) + description += "\n* Regresssion validations:\n"+wrap(Validation::VAL_REGR_PROPS.join(", "),120) + end + post_params = [[:validation_uris]] - post_command = OpenTox::PostCommand.new request.url,"Create validation report" val_uri_description = params[:report_type]=="algorithm_comparison" ? "Separate multiple uris with ','" : nil # trick for easy report creation |