Refactor CountingProbDist:
* Use weighted_sampler() for the sampling. * By not using a defaultdict, keep n_obs always up to date. * Don't inherit from ProbDist, at least for now, since we don't use anything from the superclass, and if we did it would break (e.g. __setitem__). * Remove __len__ since nobody uses it. * Use heapq.nlargest. Also separate random doctests from others, and tweak docs.
Veuillez vous inscrire ou vous connecter pour commenter