scikit-learn/scikit-learn — pull request #3552 by vene (2014-08-12 12:49:36+00:00)
Title: [MRG] Bugfix: Clone-safe vectorizers with custom vocabulary

I ran into the issue summarized by [this gist](https://gist.github.com/vene/b8a6e199ee764289c65e): Basically vectorizers throw away the `vocabulary` parameter in grid search. This is because the `__init__` function of vectorizers doesn't obey the rules required to make it clone-safe. I added a minimal test and fixed it, but it needed some more changes to the tests: many of the tests were relying to `vect.vocabulary_` to exist straight after init.

It still seems like the `__init__` does a bit more computation than it should with respect to other parameters though.