From 11dd9bce948364283654b2f056fefb933afc3e6e Mon Sep 17 00:00:00 2001 From: gebele Date: Thu, 4 Dec 2014 17:38:55 +0100 Subject: several updates in code; validation integrated, probability for classification; updated call for more details for smarts view --- views/validation.haml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 views/validation.haml (limited to 'views/validation.haml') 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)} %" + -- cgit v1.2.3