Not unless you feel like benchmarking the implications of something that isn’t either bootstrapping or jackknifing but is a hybrid sampling-rejection scheme…also, if you have a very large number of counts that are 1 (common in microbial ecology datasets) you can often run into situations where it’s seldom that you don’t get any 2’s so again it becomes inefficient.

Are you sure that np.random.choice() is going to make it much faster? Remember that you have to choose a count at random, not an item at random. It is possible that the implementation of choice() has changed since I last investigated it but at least historically it didn’t do what we needed here — essentially you need to pick a count (not an array element) at random, then decrement the count, and this might require some custom C or cython to do fast. But I acknowledge that my info might be out of date.

On Mar 25, 2014, at 8:46 AM, Jai Ram Rideout <notifications@github.com<mailto:notifications@github.com>> wrote:


In skbio/maths/subsample.py:

>
> -    Returns `counts` if `n` is equal to or larger than the number of items in
> -    `counts`.
> +    Returns a copy of `counts` if `n` is equal to or larger than the number of


Okay, thanks. Do you think we should throw an error if n is greater than the number of items? It seems strange to return the original counts vector in this case, since we technically could have "subsampled" a greater number of items when replace=True. I think the intention of this function would be clearer if we put these bound checks in place and only allowed n <= counts.sum() (where n == counts.sum() differs depending on with/without replacement).

—
Reply to this email directly or view it on GitHub<https://github.com/biocore/scikit-bio/pull/206/files#r10933261>.