summaryrefslogtreecommitdiff
path: root/views/validation.haml
diff options
context:
space:
mode:
authorgebele <gebele@in-silico.ch>2014-12-04 17:38:55 +0100
committergebele <gebele@in-silico.ch>2014-12-04 17:38:55 +0100
commit11dd9bce948364283654b2f056fefb933afc3e6e (patch)
treed4942398c95835bc3df1af72a9141b56ec0d99f4 /views/validation.haml
parent907e21a9f2e8607ef9102103ddd5fb1d5586786d (diff)
several updates in code; validation integrated, probability for classification; updated call for more details for smarts view
Diffstat (limited to 'views/validation.haml')
-rw-r--r--views/validation.haml16
1 files changed, 16 insertions, 0 deletions
diff --git a/views/validation.haml b/views/validation.haml
new file mode 100644
index 0000000..fd63ea6
--- /dev/null
+++ b/views/validation.haml
@@ -0,0 +1,16 @@
+- case @model_type
+- when "classification"
+ - prediction = @cv.metadata["http://www.opentox.org/api/1.2#classificationStatistics"]["http://www.opentox.org/api/1.2#numCorrect"] + @cv.metadata["http://www.opentox.org/api/1.2#classificationStatistics"]["http://www.opentox.org/api/1.2#numIncorrect"]
+ %p= "Number of predictions: #{prediction}"
+ - percent = @cv.metadata["http://www.opentox.org/api/1.2#classificationStatistics"]["http://www.opentox.org/api/1.2#percentCorrect"]
+ %p= "Correct predictions: #{percent.round(2)} %"
+- when "regression"
+ - prediction = @cv.metadata["http://www.opentox.org/api/1.2#numInstances"].to_i - @cv.metadata["http://www.opentox.org/api/1.2#numUnpredicted"].to_i
+ %p= "Number of predictions: #{prediction}"
+ - rSquare = @cv.metadata["http://www.opentox.org/api/1.2#regressionStatistics"]["http://www.opentox.org/api/1.2#rSquare"]
+ %p= "R-squared: #{rSquare.round(2)} %"
+ - rootMeanSquaredError = @cv.metadata["http://www.opentox.org/api/1.2#regressionStatistics"]["http://www.opentox.org/api/1.2#rootMeanSquaredError"]
+ %p= "Root Mean Square Error: #{rootMeanSquaredError.round(2)} %"
+ - meanAbsoluteError = @cv.metadata["http://www.opentox.org/api/1.2#regressionStatistics"]["http://www.opentox.org/api/1.2#meanAbsoluteError"]
+ %p= "Mean Absolute Error: #{meanAbsoluteError.round(2)} %"
+