As per the Spark 2.1.0 documentation, Both HashingTF and CountVectorizer can be used to generate the term frequency vectors. HashingTF 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. HashingTF utilizes the hashing trick. A raw feature is mapped into an index (term) by apply
