[jira] [Commented] (SPARK-7857) IDF w/ minDocFreq on SparseVectors results in literal zeros

2015-11-19 Thread Apache Spark (JIRA)

[ 
https://issues.apache.org/jira/browse/SPARK-7857?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15014329#comment-15014329
 ] 

Apache Spark commented on SPARK-7857:
-

User 'karlhigley' has created a pull request for this issue:
https://github.com/apache/spark/pull/9843

> 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: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org



[jira] [Commented] (SPARK-7857) IDF w/ minDocFreq on SparseVectors results in literal zeros

2015-06-03 Thread Joseph K. Bradley (JIRA)

[ 
https://issues.apache.org/jira/browse/SPARK-7857?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14571779#comment-14571779
 ] 

Joseph K. Bradley commented on SPARK-7857:
--

Sure, please do!

> 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: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org



[jira] [Commented] (SPARK-7857) IDF w/ minDocFreq on SparseVectors results in literal zeros

2015-06-03 Thread Karl Higley (JIRA)

[ 
https://issues.apache.org/jira/browse/SPARK-7857?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14571771#comment-14571771
 ] 

Karl Higley commented on SPARK-7857:


Ah, okay, that makes more sense.  Seems like a small fix -- maybe a decent 
starter task?  I'd be interested in giving it a try.

> 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: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org



[jira] [Commented] (SPARK-7857) IDF w/ minDocFreq on SparseVectors results in literal zeros

2015-06-03 Thread Joseph K. Bradley (JIRA)

[ 
https://issues.apache.org/jira/browse/SPARK-7857?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14571662#comment-14571662
 ] 

Joseph K. Bradley commented on SPARK-7857:
--

I looked again, and I agree the test is confusing but do think it's meant to 
test minDocFreq.  Look at the difference in how "expected" is calculated.  With 
minDocFreq = 1, the term which never appears is filtered out, rather than being 
present with the smoothed value.  (It's unsmoothed value would be 0, but IDF 
adds a single count to smooth all elements, unless they are filtered.)

> 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: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org



[jira] [Commented] (SPARK-7857) IDF w/ minDocFreq on SparseVectors results in literal zeros

2015-06-03 Thread Karl Higley (JIRA)

[ 
https://issues.apache.org/jira/browse/SPARK-7857?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14571641#comment-14571641
 ] 

Karl Higley commented on SPARK-7857:


That does seem like the intent of the test.  I started scratching my head when 
I noticed that [the minDocFreq is set to 
1|https://github.com/apache/spark/blob/master/mllib/src/test/scala/org/apache/spark/mllib/feature/IDFSuite.scala#L73],
 and that none of the terms seem to be filtered out.

> 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: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org



[jira] [Commented] (SPARK-7857) IDF w/ minDocFreq on SparseVectors results in literal zeros

2015-06-03 Thread Joseph K. Bradley (JIRA)

[ 
https://issues.apache.org/jira/browse/SPARK-7857?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14571613#comment-14571613
 ] 

Joseph K. Bradley commented on SPARK-7857:
--

Do you mean the "idf minimum document frequency filtering" test?  If so, the 
"minDocFreq" parameter is meant to filter out very uncommon terms, and that 
test is making sure it works.

> 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: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org



[jira] [Commented] (SPARK-7857) IDF w/ minDocFreq on SparseVectors results in literal zeros

2015-06-03 Thread Karl Higley (JIRA)

[ 
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: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org



[jira] [Commented] (SPARK-7857) IDF w/ minDocFreq on SparseVectors results in literal zeros

2015-06-01 Thread Joseph K. Bradley (JIRA)

[ 
https://issues.apache.org/jira/browse/SPARK-7857?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14567826#comment-14567826
 ] 

Joseph K. Bradley commented on SPARK-7857:
--

Are you sure?  It looks like IDF does not use toSparse, which would remove 
explicit zeros.

I think this JIRA is still valid.

> 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: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org



[jira] [Commented] (SPARK-7857) IDF w/ minDocFreq on SparseVectors results in literal zeros

2015-06-01 Thread Karl Higley (JIRA)

[ 
https://issues.apache.org/jira/browse/SPARK-7857?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14567520#comment-14567520
 ] 

Karl Higley commented on SPARK-7857:


This is addressed by the addition of numNonZeros in SPARK-6756.

> 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: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org