From 1b44e0cd76f2ead93b8b3fa0f970c85ef32a4b14 Mon Sep 17 00:00:00 2001 From: "helma@in-silico.ch" Date: Fri, 16 Nov 2018 22:45:17 +0100 Subject: confidence for prediction datasets --- test/classification-model.rb | 1 + test/regression-model.rb | 1 + 2 files changed, 2 insertions(+) (limited to 'test') diff --git a/test/classification-model.rb b/test/classification-model.rb index 2032bf8..79ccb98 100644 --- a/test/classification-model.rb +++ b/test/classification-model.rb @@ -90,6 +90,7 @@ class ClassificationModelTest < MiniTest::Test assert_nil result.predictions[result.compounds.first][:value] assert_equal "carcinogenic", result.predictions[result.compounds[1]][:value] assert_equal 0.27, result.predictions[result.compounds[1]][:probabilities]["non-carcinogenic"].round(2) + assert_match /High/i, result.predictions[result.compounds[1]][:confidence] end def test_carcinogenicity_rf_classification diff --git a/test/regression-model.rb b/test/regression-model.rb index b925439..7f667dc 100644 --- a/test/regression-model.rb +++ b/test/regression-model.rb @@ -179,6 +179,7 @@ class LazarRegressionTest < MiniTest::Test assert_equal [1.37], result.values(result.compounds[6], result.bioactivity_features[0]).collect{|v| v.round(2)} assert_equal [1.79], result.values(result.compounds[6], result.prediction_features[0]).collect{|v| v.round(2)} assert_equal [1.84,1.73], result.values(result.compounds[7], result.bioactivity_features[0]).collect{|v| v.round(2)} + assert_match /Low/i, result.predictions[result.compounds[6]][:confidence] end end -- cgit v1.2.3