scikit-learn/scikit-learn — pull request #3937 by larsmans (2014-12-04 21:23:55+00:00)
Title: MAINT/TST: don't set trailing "_" attrs in __init__

As I said over at gh-3627,

> we need to fix all the `__init__`s that set final-underscore attributes. Some of them set those to None or similar values. [...] we should do a systematic search of the codebase and introduce a smoke test.

I did just that.

Note: code uses `getattr(self, "someattr_", None) is None` instead of `hasattr`, in an attempt to be backwards compatible with pickled estimators that have these attributes. I'm not sure how important that is (who would pickle before fit?) and unpickling is not tested.