scikit-learn/scikit-learn — pull request #1304 by erg (2012-10-31 23:08:01+00:00)
Title: WIP: Classes support for all classifiers

I'm taking a stab at decoupling the classes in ``y`` from the classes that the estimators can predict. I think this cleanup would allow for easier design of an ensemble class that could use arbitrary classifiers and combine their results through voting, averaging, stacking, etc.

See https://github.com/scikit-learn/scikit-learn/issues/1183

So far I've done ``naive_bayes``, ``lda``, ``trees``, and ``forests``. I tried to do ``qda`` and almost got it right, but there are issues with ``nan``s, ``inf``s. ``LabelBinarizer`` needs some testing as well.

I've gone with the convention of class variables set in ``__init__`` having no trailing underscore and any other private variables using one. So ``self.classes`` gets set in ``__init__`` and then ``self.classes_`` gets set in ``fit``. Maybe there needs to be a parameter method that resets ``self.classes_`` to ``None`` so that classifiers are not in half-working states?

Any help with the remaining classifiers, code cleanups, or suggestions would be appreciated.