summaryrefslogtreecommitdiff
path: root/test/lazar-regression.rb
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2015-08-20 14:02:04 +0200
committerChristoph Helma <helma@in-silico.ch>2015-08-20 14:02:04 +0200
commit398d8ca681db3aa0a0552eee026705e60dd8449d (patch)
tree79809c5a8af87238eb86de98065a7afbacf21798 /test/lazar-regression.rb
parentd48a31ad6773864eacc08a673edb45877c9b7972 (diff)
crossvalidation fixesv0.0.7
Diffstat (limited to 'test/lazar-regression.rb')
-rw-r--r--test/lazar-regression.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/lazar-regression.rb b/test/lazar-regression.rb
new file mode 100644
index 0000000..c36f521
--- /dev/null
+++ b/test/lazar-regression.rb
@@ -0,0 +1,27 @@
+require_relative "setup.rb"
+
+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
+ compound = Compound.from_smiles "CC(C)(C)CN"
+ prediction = model.predict compound
+ assert_equal 13.6, prediction[:value].round(1)
+ assert_equal 0.83, prediction[:confidence].round(2)
+ assert_equal 1, prediction[:neighbors].size
+ end
+
+ def test_weighted_average_with_relevant_fingerprints
+ training_dataset = Dataset.from_csv_file "#{DATA_DIR}/EPAFHM.medi.csv"
+ model = Model::LazarRegression.create training_dataset
+ model.update(:prediction_algorithm => "OpenTox::Algorithm::Regression.weighted_average_with_relevant_fingerprints")
+ 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
+ end
+
+end