diff --git a/sklearn/feature_extraction/text.py b/sklearn/feature_extraction/text.py index e0d567368f92aab041dd87a4642686ca0a3f4c5d..fa7306ab9def566d62f5ab63bbba6dab474158e2 100644 --- a/sklearn/feature_extraction/text.py +++ b/sklearn/feature_extraction/text.py @@ -306,7 +306,7 @@ class VectorizerMixin(object): raise ValueError("Vocabulary is empty") -class HashingVectorizer(BaseEstimator, VectorizerMixin): +class HashingVectorizer(BaseEstimator, VectorizerMixin, TransformerMixin): """Convert a collection of text documents to a matrix of token occurrences It turns a collection of text documents into a scipy.sparse matrix holding @@ -523,9 +523,6 @@ class HashingVectorizer(BaseEstimator, VectorizerMixin): X = normalize(X, norm=self.norm, copy=False) return X - # Alias transform to fit_transform for convenience - fit_transform = transform - def _get_hasher(self): return FeatureHasher(n_features=self.n_features, input_type='string', dtype=self.dtype,