… Make NaiveBayesLearner use target-value frequencies too.
…. (Avoids bug that bit me.)
* 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.
…itive to trivial changes. Needs real tests instead.
* graph_search missed deduping nodes in the frontier * astar_search didn't use 3rd-edition pseudocode * InstrumentedProblem didn't forward the path_cost method, so all the doctest results on instrumented cost-sensitive problems were wrong Also filled in breadth_first_search and per-node memoization of h (to fulfill the doc comment saying that was done). There's a remaining problem that sometimes trivial refactorings change the amount of search that is done, slightly, which should not happen since the code is supposed to be deterministic.
…w Struct members in sorted order so doctests work in pypy.