summaryrefslogtreecommitdiff
path: root/views
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 /views
parent8e95b8a63c3a5ce8b8cafb64233e77e21d57bbef (diff)
test validation results
Diffstat (limited to 'views')
-rw-r--r--views/model_details.haml117
1 files changed, 117 insertions, 0 deletions
diff --git a/views/model_details.haml b/views/model_details.haml
new file mode 100644
index 0000000..251fca8
--- /dev/null
+++ b/views/model_details.haml
@@ -0,0 +1,117 @@
+%b Model:
+%br
+Source:
+%a{:href=>model.source, :target=>"external"}
+ = model.source
+%br
+- model.classification? ? type = "Classification" : type = "Regression"
+= "Type:\t"
+= type
+%br
+- training_dataset = OpenTox::Dataset.find model.training_dataset.id
+= "Training compounds:\t"
+= training_dataset.compounds.size
+
+%p
+- if type == "Classification"
+ %b Independent crossvalidations:
+- else
+ %b Independent crossvalidations (-log10 transformed):
+%div.row{:id=>"validations#{model.id}", :style=>"background-color:#f5f5f5;"}
+ - model.crossvalidations.each do |crossvalidation|
+ %span.col-xs-4.col-sm-4.col-md-4.col-lg-4
+ - cv = OpenTox::CrossValidation.find crossvalidation.id
+ = "Num folds:\t"
+ = cv.folds
+ %br
+ = "Num instances:\t"
+ = cv.nr_instances
+ %br
+ = "Num unpredicted"
+ = cv.nr_unpredicted
+ - if model.classification?
+ %br
+ = "Accuracy:\t"
+ = cv.accuracy.round(3) if cv.accuracy
+ %br
+ = "True positive rate:\t"
+ = cv.true_rate["active"].round(3) if cv.true_rate["active"]
+ %br
+ = "True negative rate:\t"
+ = cv.true_rate["inactive"].round(3) if cv.true_rate["inactive"]
+ %br
+ = "Positive predictive value:\t"
+ = cv.predictivity["active"].round(3) if cv.predictivity["active"]
+ %br
+ = "Negative predictive value:\t"
+ = cv.predictivity["inactive"].round(3) if cv.predictivity["inactive"]
+ %p
+ %b Confusion Matrix:
+ %table.table.table-condensed.table-borderless{:style=>"width:20%;"}
+ %tbody
+ %tr
+ %td
+ %td
+ %td
+ %b actual
+ %td
+ %td
+ %tr
+ %td
+ %td
+ %td active
+ %td inactive
+ -#%td total
+ %tr
+ %td
+ %b predicted
+ %td active
+ %td
+ =cv.confusion_matrix[0][0]
+ %td
+ =cv.confusion_matrix[0][1]
+ -#%td
+ =cv.confusion_matrix[0][0]+cv.confusion_matrix[0][1]
+ %tr
+ %td
+ %td inactive
+ %td
+ =cv.confusion_matrix[1][0]
+ %td
+ =cv.confusion_matrix[1][1]
+ -#%td
+ =cv.confusion_matrix[1][0]+cv.confusion_matrix[1][1]
+ -#%tr
+ %td
+ %td total
+ %td
+ =cv.confusion_matrix[0][0]+cv.confusion_matrix[1][0]
+ %td
+ =cv.confusion_matrix[0][1]+cv.confusion_matrix[1][1]
+ %td
+ -#= "Confusion Matrix:\t"
+ -#= cv.confusion_matrix
+ %br
+ /= "Confidence plot:"
+ /%p.plot
+ / %img{:src=>"confp#{cv.id}.svg"}
+ - if model.regression?
+ %br
+ = "Root mean squared error:\t"
+ = cv.rmse.round(3) if cv.rmse
+ %br
+ = "Mean absolute error:\t"
+ = cv.mae.round(3) if cv.mae
+ %br
+ = "R square:\t"
+ = cv.r_squared.round(3) if cv.r_squared
+ %br
+ /= "Confidence plot:"
+ /%p.plot
+ / %img{:src=>"/confp#{cv.id}.svg"}
+ /%br
+ /= "Correlation plot"
+ /%p.plot
+ / %img{:src=>"/corrp#{cv.id}.svg"}
+
+%br \ No newline at end of file