Skip to content

Commit 02bff9e

Browse files
committed
Updated feature_extraction doc
1 parent 3142890 commit 02bff9e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

doc/modules/feature_extraction.rst

+4-5
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,10 @@ Since the hash function might cause collisions between (unrelated) features,
125125
a signed hash function is used and the sign of the hash value
126126
determines the sign of the value stored in the output matrix for a feature.
127127
This way, collisions are likely to cancel out rather than accumulate error,
128-
and the expected mean of any output feature's value is zero.
129-
130-
If ``non_negative=True`` is passed to the constructor, the absolute
131-
value is taken. This undoes some of the collision handling, but allows
132-
the output to be passed to estimators like
128+
and the expected mean of any output feature's value is zero. This mechanism
129+
is enabled by default with ``alternate_sign=True`` and is particularly useful
130+
for small hash table sizes (``n_features < 10000``). For large hash table
131+
sizes, it can be disabled to allow the output to be passed to estimators like
133132
:class:`sklearn.naive_bayes.MultinomialNB` or
134133
:class:`sklearn.feature_selection.chi2`
135134
feature selectors that expect non-negative inputs.

0 commit comments

Comments
 (0)