summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorrautenberg <rautenberg@in-silico.ch>2016-09-14 14:43:39 +0200
committerrautenberg <rautenberg@in-silico.ch>2016-09-14 14:43:39 +0200
commitdc5d0dbbb8029a163f766bfbd8ea6db8774496e1 (patch)
tree471c11b999ed63b5475d5b0e0a023196da2a42de /lib
parent8e95b8a63c3a5ce8b8cafb64233e77e21d57bbef (diff)
test validation results
Diffstat (limited to 'lib')
-rw-r--r--lib/report.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/report.rb b/lib/report.rb
index 2cf6b83..628b095 100644
--- a/lib/report.rb
+++ b/lib/report.rb
@@ -27,6 +27,7 @@ get "/report/:id/?" do
model = Model::Lazar.find params[:id]
resource_not_found_error "Model with id: #{params[:id]} not found." unless model
prediction_model = Model::Prediction.find_by :model_id => params[:id]
+ validation_template = File.join(File.dirname(__FILE__),"views/model_details.haml")
if File.directory?("#{File.dirname(__FILE__)}/../../lazar")
lazar_commit = `cd #{File.dirname(__FILE__)}/../../lazar; git rev-parse HEAD`.strip
@@ -141,10 +142,16 @@ get "/report/:id/?" do
report.change_attributes "dependent_var_availability", {:answer => "All"}
# Other information about the training set 6.5
- report.value "other_info", "#{model.source}"
+ report.value "other_info", "#{prediction_model.source}"
# Pre-processing of data before modelling 6.6
- report.value "preprocessing", (model.class == OpennTox::Model::LazarRegression ? "-Log 10 transformation" : "none")
+ report.value "preprocessing", (model.class == OpenTox::Model::LazarRegression ? "-log 10 transformation" : "none")
+
+ if model.crossvalidations
+ crossvalidations = model.crossvalidations
+ out = Haml::Engine.new(File.read(validation_template)).render @report
+ report.value "lmo", CGI.escapeHTML(out)
+ end
# output
response['Content-Type'] = "application/xml"