From b204558ac35e2eae7a2407ae401482972e124187 Mon Sep 17 00:00:00 2001 From: David Vorgrimmler Date: Wed, 6 Jun 2012 18:21:43 +0200 Subject: Modified lazar test. --- lazar.rb | 9 +++++---- 1 file 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 -- cgit v1.2.3