Right! That's a ProbDist object. It's basically a mapping from labels
to probabilities.
You can ask it what the possible labels are with .samples() and get
the probability for a given label with .prob(). For example, consider
this two-way classification task:
>>> import nltk
>>> examples = [({"blue":True, "red":False},"BlueOne"), ({"blue":False,"red":True},"RedOne")]
>>> classifier = nltk.classify.naivebayes.NaiveBayesClassifier.train(examples)
>>> classifier.prob_classify({"blue":True,"red":False})
<ProbDist with 2 samples>
>>> dist = classifier.prob_classify({"blue":True,"red":False})
>>> list(dist.samples())
['BlueOne', 'RedOne']
>>> dist.prob("BlueOne")
0.9
On Thu, Nov 28, 2013 at 7:49 PM, J <
jrubi...@gmail.com> wrote:
> Hm, it's just giving me:
> <ProbDist with 2 samples>
--
-- alexr