summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavor <vorgrimmlerdavid@gmx.de>2012-01-04 15:57:02 +0100
committerdavor <vorgrimmlerdavid@gmx.de>2012-01-04 15:57:02 +0100
commit23dcfd67b4c5970a25b9963031ed80c9ea515995 (patch)
treec004081167fda1983e17a9d9a70a4655876ebef9
parent5ab8e5c1cac69b3ae0591ba32a17da72202df9b8 (diff)
Enabled pcr test
-rw-r--r--lazar.rb26
1 files changed, 8 insertions, 18 deletions
diff --git a/lazar.rb b/lazar.rb
index 02ba3cc..540ff8b 100644
--- a/lazar.rb
+++ b/lazar.rb
@@ -189,24 +189,14 @@ class LazarTest < Test::Unit::TestCase
cleanup
end
-
-# def test_regression_mlr_prop_model
-# create_model :dataset_uri => @@regression_training_dataset.uri, :prediction_algorithm => "local_mlr_prop"
-# predict_compound OpenTox::Compound.from_smiles("c1ccccc1NN")
-# assert_equal 0.610, @predictions.first.confidence(@compounds.first).round_to(3)
-# assert_equal 0.615, @predictions.first.value(@compounds.first).round_to(3)
-# assert_equal 253, @predictions.first.neighbors(@compounds.first).size
-# assert_equal 131, @model.features.size
-# end
-
-# def test_regression_mlr_prop_conf_stdev
-# create_model :dataset_uri => @@regression_training_dataset.uri, :prediction_algorithm => "local_mlr_prop", :conf_stdev => "true"
-# predict_compound OpenTox::Compound.from_smiles("c1ccccc1NN")
-# assert_equal 0.154, @predictions.first.confidence(@compounds.first).round_to(3)
-# assert_equal 0.265, @predictions.first.value(@compounds.first).round_to(3)
-# assert_equal 253, @predictions.first.neighbors(@compounds.first).size
-# assert_equal 131, @model.features.size
-# end
+ def test_create_regression_pc_mlr_prop_model
+ create_model :dataset_uri => @@regression_training_dataset.uri, :feature_dataset_uri => @@regression_feature_dataset.uri, :pc_type => "constitutional", :prediction_algorithm => "local_mlr_prop"
+ predict_compound OpenTox::Compound.from_smiles("c1ccccc1NN")
+ assert_in_delta @predictions.first.value(@compounds.first), 1.05, 0.2
+ assert_equal 0.557, @predictions.first.confidence(@compounds.first).round_to(3)
+ assert_equal 157, @predictions.first.neighbors(@compounds.first).size
+ cleanup
+ end
# def test_conf_stdev
# params = {:sims => [0.6,0.72,0.8], :acts => [1,1,1], :neighbors => [1,1,1], :conf_stdev => true}