Github user MLnick commented on a diff in the pull request:
https://github.com/apache/spark/pull/12454#discussion_r60013175
--- Diff: docs/ml-features.md ---
@@ -22,10 +22,19 @@ This section covers algorithms for working with
features, roughly divided into t
[Term Frequency-Inverse Document Frequency
(TF-IDF)](http://en.wikipedia.org/wiki/Tf%E2%80%93idf) is a common text
pre-processing step. In Spark ML, TF-IDF is separate into two parts: TF
(+hashing) and IDF.
-**TF**: `HashingTF` is a `Transformer` which takes sets of terms and
converts those sets into fixed-length feature vectors. In text processing, a
"set of terms" might be a bag of words.
-The algorithm combines Term Frequency (TF) counts with the [hashing
trick](http://en.wikipedia.org/wiki/Feature_hashing) for dimensionality
reduction.
+**TF**: Both `HashingTF` and `CountVectorizer` can be used to get the term
frequency.
-**IDF**: `IDF` is an `Estimator` which fits on a dataset and produces an
`IDFModel`. The `IDFModel` takes feature vectors (generally created from
`HashingTF`) and scales each column. Intuitively, it down-weights columns
which appear frequently in a corpus.
+`HashingTF` is a `Transformer` which takes sets of terms and converts
those sets into
+fixed-length feature vectors. In text processing, a "set of terms" might
be a bag of words.
+The algorithm combines Term Frequency (TF) counts with the
+[hashing trick](http://en.wikipedia.org/wiki/Feature_hashing) for
dimensionality reduction.
+
+`CountVectorizer` converts text documents to vectors of token counts.
Refer to [CountVectorizer
--- End diff --
we refer to `token counts` here but `term counts` elsewhere in this
section. They're interchangeable but let's stick to `term counts` throughout.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]