HannahVMeyer / limmbo

Apache License 2.0
10 stars 0 forks source link

length entries in bootstrap_array #4

Closed HannahVMeyer closed 5 years ago

HannahVMeyer commented 6 years ago

In function (multiple_set_covers_all)[https://github.com/HannahVMeyer/limmbo/blob/master/limmbo/utils/utils.py], the length of the entries in bootstrap_array is adjusted to be max(length_array), however it should be sample_size_ori.

odysseusulysses commented 6 years ago

Found the issue, will be able to update with a new version tonight.

HannahVMeyer commented 6 years ago

Still issue with coverage and entry length of returned bootstrap list: This yields the expected results:

sample_size=10
number_of_covers=3
>>>test =  multiple_set_covers_all(number_of_traits=100, sample_size=sample_size number_of_covers=number_of_covers, seed=301)
>>>test['counts'].min() == number_of_covers
True
>>>set([len(x) for x in test['bootstrap']])
{10}

For smaller sample sizes, this fails both in the length of the returned list elements and in the number of covers.

sample_size=5
number_of_covers=3
>>>test =  multiple_set_covers_all(number_of_traits=100, sample_size=sample_size, number_of_covers=number_of_covers, seed=301)
>>>test['counts'].min() == number_of_covers
False
>>>test['counts'].min()
1.0
>>>set([len(x) for x in test['bootstrap']])
{3, 4, 5}
odysseusulysses commented 6 years ago

That last commit should fix it I think.

odysseusulysses commented 6 years ago

Actually there's still a case I'm missing. give me a few minutes

odysseusulysses commented 6 years ago

By a few minutes I meant 3 hours obviously :)

Basically it only worked for sample_sizes that were even numbers. I wasn't being very careful how I used `sample_size//2' to move around my indexes so I lost some precision. Should be fixed now