diff options
author | helma@in-silico.ch <helma@in-silico.ch> | 2018-11-16 22:45:17 +0100 |
---|---|---|
committer | helma@in-silico.ch <helma@in-silico.ch> | 2018-11-16 22:45:17 +0100 |
commit | 1b44e0cd76f2ead93b8b3fa0f970c85ef32a4b14 (patch) | |
tree | 554447ba32d3e2355988e86e0676ba00f63698f1 /test | |
parent | c12d5bb40ab2a0783f755c3238a20448b9a5a42e (diff) |
confidence for prediction datasets
Diffstat (limited to 'test')
-rw-r--r-- | test/classification-model.rb | 1 | ||||
-rw-r--r-- | test/regression-model.rb | 1 |
2 files changed, 2 insertions, 0 deletions
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 |