On 07/22/2013 02:13 PM, Lars Buitinck wrote:
>
> In sklearn/naive_bayes.py:
>
> > +
> > +        elif (classes is not None
> > +              and getattr(self, 'classes_', None) is not None):
> > +            if not np.all(self.classes_ == np.unique(classes)):
> > +                raise ValueError(
> > +                    "`classes=%r` is not the same as on last call "
> > +                    "to partial_fit, was: %r" % (classes, self.classes_))
> > +
> > +        elif classes is not None:
> > +            # This is the first call to partial_fit
> > +            self.classes_ = classes
> > +
> > +            # Build a label binarizer instance that will be reused for all the
> > +            # consecutive calls to partial_fit
> > +            self._labelbin = LabelBinarizer()
> > +            self._labelbin.classes_ = self.classes_
>
> Found it, but I'm not sure if that makes things much more elegant (the 
> complexity just seems to move from the place that causes it to 
> elsewhere in the library).
>
Don't you think the feature is useful in general?