summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Vorgrimmler <vorgrimmlerdavid@gmx.de>2012-06-06 18:21:43 +0200
committerDavid Vorgrimmler <vorgrimmlerdavid@gmx.de>2012-06-06 18:21:43 +0200
commitb204558ac35e2eae7a2407ae401482972e124187 (patch)
tree34936da75b747deefd40956264989b57a74f9e4f
parentc91732c884c7b4b664791928c3f28d57f43b57b3 (diff)
Modified lazar test.
-rw-r--r--lazar.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/lazar.rb b/lazar.rb
index 1a19b61..9818092 100644
--- a/lazar.rb
+++ b/lazar.rb
@@ -27,6 +27,7 @@ class LazarTest < Test::Unit::TestCase
def create_model(params)
params[:subjectid] = @@subjectid
+ params[:min_frequency] = "8"
model_uri = OpenTox::Algorithm::Lazar.new.run(params).to_s
@model = OpenTox::Model::Lazar.find model_uri, @@subjectid
dump @model, File.join(@dump_dir,caller[0][/`.*'/][1..-2],"model")+".yaml"
@@ -84,8 +85,8 @@ def test_classification_model
# assertions
# single prediction
assert_equal "false", @predictions[0].value(@compounds[0])
- assert_equal 0.3383.round_to(4), @predictions[0].confidence(@compounds[0]).round_to(4)
- assert_equal 16, @predictions[0].neighbors(@compounds[0]).size
+ assert_equal 0.3443.round_to(4), @predictions[0].confidence(@compounds[0]).round_to(4)
+ assert_equal 18, @predictions[0].neighbors(@compounds[0]).size
# dataset activity
assert !@predictions[1].measured_activities(@compounds[1]).empty?
assert_equal "true", @predictions[1].measured_activities(@compounds[1]).first.to_s
@@ -96,9 +97,9 @@ def test_classification_model
assert_equal "true", @predictions[2].measured_activities(c).first.to_s
c = OpenTox::Compound.from_smiles("c1ccccc1NN")
assert_equal "false", @predictions[2].value(c)
- assert_equal 0.3383 , @predictions[2].confidence(c).round_to(4)
+ assert_equal 0.3443 , @predictions[2].confidence(c).round_to(4)
# model
- assert_equal 41, @model.features.size
+ assert_equal 25, @model.features.size
cleanup
end