Permalink
Browse files

As per discussion in nltk#224

  • Loading branch information...
1 parent 96f0c36 commit ddb25430b99a4742932de375dc7d627576a0e8c1 @xim xim committed Feb 19, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 nltk/classify/naivebayes.py
@@ -34,7 +34,7 @@
from collections import defaultdict
-from nltk.probability import FreqDist, ConditionalFreqDist, DictionaryProbDist, ELEProbDist, sum_logs
+from nltk.probability import FreqDist, DictionaryProbDist, ELEProbDist, sum_logs
from api import ClassifierI
@@ -184,7 +184,7 @@ def train(labeled_featuresets, estimator=ELEProbDist):
i.e., a list of tuples ``(featureset, label)``.
"""
label_freqdist = FreqDist()
- feature_freqdist = ConditionalFreqDist()
+ feature_freqdist = defaultdict(FreqDist)
feature_values = defaultdict(set)
fnames = set()

0 comments on commit ddb2543

Please sign in to comment.