diff options
Diffstat (limited to 'views/validation.haml')
-rw-r--r-- | views/validation.haml | 16 |
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)} %" + |