"metaperl.com" <[EMAIL PROTECTED]> wrote: > Per http://docs.python.org/lib/defaultdict-examples.html > > It seems that there is a default factory which initializes each key to > 1. So by the end of train(), each member of the dictionary model will > have value >= 1 > > But why wouldnt he set the value to zero and then increment it each > time a "feature" (actually a word) is encountered? It seems that each > model value would be 1 more than it should be. > The author explains his reasoning in the article: he wants to treat novel words (i.e. those which did not appear in the training corpus) as having been seen once.
-- http://mail.python.org/mailman/listinfo/python-list