-
- Downloads
[SPARK-14497][ML] Use top instead of sortBy() to get top N frequent words as...
[SPARK-14497][ML] Use top instead of sortBy() to get top N frequent words as dict in ConutVectorizer ## What changes were proposed in this pull request? Replace sortBy() with top() to calculate the top N frequent words as dictionary. ## How was this patch tested? existing unit tests. The terms with same TF would be sorted in descending order. The test would fail if hardcode the terms with same TF the dictionary like "c", "d"... Author: fwang1 <desperado.wf@gmail.com> Closes #12265 from lionelfeng/master.
Showing
- mllib/src/main/scala/org/apache/spark/ml/feature/CountVectorizer.scala 4 additions, 10 deletions...n/scala/org/apache/spark/ml/feature/CountVectorizer.scala
- mllib/src/test/scala/org/apache/spark/ml/feature/CountVectorizerSuite.scala 4 additions, 3 deletions...la/org/apache/spark/ml/feature/CountVectorizerSuite.scala
Loading
Please register or sign in to comment