[
https://issues.apache.org/jira/browse/SPARK-7857?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14571220#comment-14571220
]
Karl Higley commented on SPARK-7857:
------------------------------------
Agreed. numNonZeros works for my use case, but I had to go find it first.
"Vectors.sparse(...).toSparse()" looks a little strange, but probably produces
a less surprising result.
I'd submit a PR to make that change, but I'm confused by the minDocFreq test.
It appears to test that filtering out terms occurring in less than one document
works as expected. Maybe I'm misreading?
> IDF w/ minDocFreq on SparseVectors results in literal zeros
> -----------------------------------------------------------
>
> Key: SPARK-7857
> URL: https://issues.apache.org/jira/browse/SPARK-7857
> Project: Spark
> Issue Type: Bug
> Components: MLlib
> Reporter: Karl Higley
> Priority: Minor
>
> When the IDF model's minDocFreq parameter is set to a non-zero threshold, the
> IDF for any feature below that threshold is set to zero. When the model is
> used to transform a set of SparseVectors containing that feature, the
> resulting SparseVectors contain entries whose values are zero. The zero
> entries should be omitted in order to simplify downstream processing.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]