diff options
author | Christoph Helma <helma@in-silico.ch> | 2015-10-07 12:34:02 +0200 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2015-10-07 12:34:02 +0200 |
commit | 8d2f1c8a0f6cc9f7a481d1117bf8b3351130b1ea (patch) | |
tree | e02208fee7d7548270e23aa37c7505691f3c5cde /test/lazar-regression.rb | |
parent | be95000d7c14174286ddc8f1717c4b6c46e0c1cc (diff) |
generalised fingerprints
Diffstat (limited to 'test/lazar-regression.rb')
-rw-r--r-- | test/lazar-regression.rb | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/test/lazar-regression.rb b/test/lazar-regression.rb index 8b2d473..4f5a332 100644 --- a/test/lazar-regression.rb +++ b/test/lazar-regression.rb @@ -4,23 +4,21 @@ class LazarRegressionTest < MiniTest::Test def test_weighted_average training_dataset = Dataset.from_csv_file "#{DATA_DIR}/EPAFHM.medi.csv" - model = Model::LazarRegression.create training_dataset + model = Model::LazarRegression.create training_dataset, {:neighbor_algorithm_parameters => {:min_sim => 0}} compound = Compound.from_smiles "CC(C)(C)CN" prediction = model.predict compound - #p prediction - assert_equal 13.6, prediction[:value].round(1) - #assert_equal 0.83, prediction[:confidence].round(2) - assert_equal 1, prediction[:neighbors].size + assert_equal 7.2, prediction[:value].round(1) + assert_equal 91, prediction[:neighbors].size end def test_mpd_fingerprints training_dataset = Dataset.from_csv_file "#{DATA_DIR}/EPAFHM.medi.csv" model = Model::LazarRegression.create training_dataset - model.neighbor_algorithm_parameters[:type] = "mpd" + model.neighbor_algorithm_parameters[:type] = "MP2D" compound = Compound.from_smiles "CCCSCCSCC" prediction = model.predict compound - assert_equal 0.04, prediction[:value].round(2) - assert_equal 1, prediction[:neighbors].size + assert_equal 0.02, prediction[:value].round(2) + assert_equal 3, prediction[:neighbors].size end def test_local_linear_regression |