summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Maunz <andreas@maunz.de>2011-06-30 13:55:01 +0200
committerAndreas Maunz <andreas@maunz.de>2011-06-30 13:55:01 +0200
commitfe6a64a503507d905a61505958e795b2bca251b1 (patch)
treeb83517a79337e3dbab641dd7978cd337a0e421ce
parent2149d6e017d747927ccef80bab9e0709491a76ea (diff)
parent1a99a5e0a9b9d45963a060a63e3a8b97d15d36fb (diff)
Merge branch 'development' into release/v2.1.0
-rw-r--r--fminer.rb84
-rw-r--r--lazar.rb12
2 files changed, 48 insertions, 48 deletions
diff --git a/fminer.rb b/fminer.rb
index ade99a4..d553ac7 100644
--- a/fminer.rb
+++ b/fminer.rb
@@ -68,7 +68,7 @@ class FminerTest < Test::Unit::TestCase
feature = File.join @@regression_training_dataset.uri,"feature/LC50_mmol"
@dataset_uri = OpenTox::Algorithm::Fminer::BBRC.new.run({:dataset_uri => @@regression_training_dataset.uri, :prediction_feature => feature, :subjectid => @@subjectid, :feature_type=>"paths"}).to_s
dump
- assert_equal 177, @dataset.features.size # 32 bit
+ assert_equal 132, @dataset.features.size # 32 bit
#assert_equal 219, @dataset.features.size
# assert no hit counts present
@@ -76,13 +76,13 @@ class FminerTest < Test::Unit::TestCase
@dataset.data_entries.each { |c,e|
if c.to_s.scan('InChI=1S/C5H10N2O2S/c1-4(10-3)7-9-5(8)6-2/h1-3H3,(H,6,8)').size > 0
e.each { |p,h|
- if p.to_s.scan('bbrc/92').size>0
+ if p.to_s.scan('bbrc/87').size>0
count += 1 if h[0] == true
end
- if p.to_s.scan('bbrc/129').size>0
+ if p.to_s.scan('bbrc/54').size>0
count += 1 if h[0] == true
end
- if p.to_s.scan('bbrc/56').size>0
+ if p.to_s.scan('bbrc/32').size>0
count += 1 if h[0] == true
end
}
@@ -141,44 +141,44 @@ class FminerTest < Test::Unit::TestCase
end
- def test_regression_last
- feature = File.join @@regression_training_dataset.uri,"feature/LC50_mmol"
- @dataset_uri = OpenTox::Algorithm::Fminer::LAST.new.run({:dataset_uri => @@regression_training_dataset.uri, :prediction_feature => feature,
- :min_frequency => 40,
- :subjectid => @@subjectid}).to_s
- dump
- assert_equal 17, @dataset.features.size
-
-
- # assert no hit counts present
- count=0
- @dataset.data_entries.each { |c,e|
- if c.to_s.scan('InChI=1S/C9H10O3/c1-2-12-9-5-7(6-10)3-4-8(9)11/h3-6,11H,2H2,1H3').size > 0
- e.each { |p,h|
- if p.to_s.scan('last/6').size>0
- count += 1 if h[0] == true
- end
- if p.to_s.scan('last/13').size>0
- count += 1 if h[0] == true
- end
- if p.to_s.scan('last/8').size>0
- count += 1 if h[0] == true
- end
- }
- end
- }
- assert_equal 3, count
-
- # assert some values
- @dataset.features.each { |c,e|
- if c.to_s.scan('feature/last/3').size > 0
- assert_equal e['http://www.opentox.org/api/1.1#effect'], "activating"
- assert_equal e['http://www.opentox.org/api/1.1#pValue'].to_f.round_to(2), 0.45
- assert_equal e['http://www.opentox.org/api/1.1#smarts'], "[#8&A]-[#6&A]-[#6&A]-[#6&A]-[#6&A]-[#6&A]"
- end
- }
- cleanup
- end
+ def test_regression_last
+ feature = File.join @@regression_training_dataset.uri,"feature/LC50_mmol"
+ @dataset_uri = OpenTox::Algorithm::Fminer::LAST.new.run({:dataset_uri => @@regression_training_dataset.uri, :prediction_feature => feature,
+ :min_frequency => 40,
+ :subjectid => @@subjectid}).to_s
+ dump
+ assert_equal 21, @dataset.features.size
+
+
+ # assert no hit counts present
+ count=0
+ @dataset.data_entries.each { |c,e|
+ if c.to_s.scan('InChI=1S/C9H10O3/c1-2-12-9-5-7(6-10)3-4-8(9)11/h3-6,11H,2H2,1H3').size > 0
+ e.each { |p,h|
+ if p.to_s.scan('last/17').size>0
+ count += 1 if h[0] == true
+ end
+ if p.to_s.scan('last/18').size>0
+ count += 1 if h[0] == true
+ end
+ if p.to_s.scan('last/20').size>0
+ count += 1 if h[0] == true
+ end
+ }
+ end
+ }
+ assert_equal 3, count
+
+ # assert some values
+ @dataset.features.each { |c,e|
+ if c.to_s.scan('feature/last/3').size > 0
+ assert_equal e['http://www.opentox.org/api/1.1#effect'], "activating"
+ assert_equal e['http://www.opentox.org/api/1.1#pValue'].to_f.round_to(2), 0.99
+ assert_equal e['http://www.opentox.org/api/1.1#smarts'], "[#6&A]-[#6&a]:[#6&a]:[#6&a]:[#6&a]:[#6&a]"
+ end
+ }
+ cleanup
+ end
diff --git a/lazar.rb b/lazar.rb
index 9c4c50c..bd9139d 100644
--- a/lazar.rb
+++ b/lazar.rb
@@ -65,18 +65,18 @@ class LazarTest < Test::Unit::TestCase
def test_create_regression_model
create_model :dataset_uri => @@regression_training_dataset.uri
predict_compound OpenTox::Compound.from_smiles("c1ccccc1NN")
- assert_equal 0.327.round_to(3), @predictions.first.value(@compounds.first).round_to(3)
- assert_equal 0.318.round_to(3), @predictions.first.confidence(@compounds.first).round_to(3)
- assert_equal 69, @predictions.first.neighbors(@compounds.first).size
+ assert_equal 0.423.round_to(3), @predictions.first.value(@compounds.first).round_to(3)
+ assert_equal 0.263.round_to(3), @predictions.first.confidence(@compounds.first).round_to(3)
+ assert_equal 121, @predictions.first.neighbors(@compounds.first).size
cleanup
end
def test_create_regression_prop_model
create_model :dataset_uri => @@regression_training_dataset.uri, :local_svm_kernel => "propositionalized"
predict_compound OpenTox::Compound.from_smiles("c1ccccc1NN")
- assert_equal 0.318.round_to(3), @predictions.first.confidence(@compounds.first).round_to(3)
- assert_equal 69, @predictions.first.neighbors(@compounds.first).size
- assert_equal 177, @model.features.size
+ assert_equal 0.263.round_to(3), @predictions.first.confidence(@compounds.first).round_to(3)
+ assert_equal 121, @predictions.first.neighbors(@compounds.first).size
+ assert_equal 132, @model.features.size
cleanup
end