diff options
author | Christoph Helma <helma@in-silico.ch> | 2016-02-29 13:02:37 +0100 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2016-02-29 13:02:37 +0100 |
commit | c4b56b22fd6e65633deb7e52bd99865e3bee8f00 (patch) | |
tree | 5aa42c438fcc16d724a788d15d0d374914d8a227 /test/dataset.rb | |
parent | 72f6cd966a249859e009a0db5f7b089aad1d6511 (diff) |
crossvalidation folds fixed for duplicates
Diffstat (limited to 'test/dataset.rb')
-rw-r--r-- | test/dataset.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/dataset.rb b/test/dataset.rb index 1814081..76eaf60 100644 --- a/test/dataset.rb +++ b/test/dataset.rb @@ -213,5 +213,17 @@ class DatasetTest < MiniTest::Test end end + def test_folds + dataset = Dataset.from_csv_file File.join(DATA_DIR,"loael.csv") + dataset.folds(10).each do |fold| + fold.each do |d| + assert_equal d.data_entries.size, d.compound_ids.size + assert_operator d.compound_ids.size, :>=, d.compound_ids.uniq.size + end + assert_operator fold[0].compound_ids.uniq.size, :>=, fold[1].compound_ids.uniq.size + end + #puts dataset.folds 10 + end + end |