Uh oh!
There was an error while loading. Please reload this page.
[SPARK-14238][ML][MLLIB][PYSPARK] Add binary toggle Param to PySpark HashingTF in ML & MLlib - #12079
[SPARK-14238][ML][MLLIB][PYSPARK] Add binary toggle Param to PySpark HashingTF in ML & MLlib#12079yongtang wants to merge 5 commits into
Conversation
MLnick
commented
Mar 31, 2016
ok to test |
SparkQA
commented
Mar 31, 2016
Test build #54623 has finished for PR 12079 at commit
|
SparkQA
commented
Mar 31, 2016
Test build #54631 has finished for PR 12079 at commit
|
There was a problem hiding this comment.
We should keep the doc of the Param consistent with Scala.
SparkQA
commented
Mar 31, 2016
Test build #54642 has finished for PR 12079 at commit
|
…HashingTF in ML & MLlib This fix tries to add binary toggle Param to PySpark HashingTF in ML & MLlib. If this toggle is set, then all non-zero counts will be set to 1. This fix adds two tests to cover the code changes. One for HashingTF in PySpark's ML and one for HashingTF in PySpark's MLLib.
yongtang
commented
Apr 11, 2016
Rebased to fix conflicts. |
SparkQA
commented
Apr 11, 2016
Test build #55524 has finished for PR 12079 at commit
|
holdenk
commented
Apr 11, 2016
One minor note:Often we want to go with Scala first then Python, but in either direction if we are only doing one at a time it can be good practice to create either a follow up JIRA or a subtask on the existing JIRA to also expose the implementation in the other language. |
| .. versionadded:: 1.3.0 | ||
| """ | ||
| binary = Param(Params._dummy(), "binary", "If true, all non zero counts are set to 1. " + |
There was a problem hiding this comment.
We probably want to mention the default value here (namely false).
There was a problem hiding this comment.
Thanks @holdenk this issue has been addressed.
There was a problem hiding this comment.
Great! Looking at the incoming PRs it seems there is a second PR also adding a binary feature to another model - it might make sense to move this to a shared param instead of having it be per-model (although it will require coordination with the other PR timing wise).
yongtang
commented
Apr 12, 2016
@holdenk The Scala implementation has ben completed in SPARK-13963. I updated the description of this pull request to show the linkage between this issue (SPARK-14238) and SPARK-13963. |
SparkQA
commented
Apr 12, 2016
Test build #55587 has finished for PR 12079 at commit
|
| binary = Param(Params._dummy(), "binary", "If true, all non zero counts are set to 1. " + | ||
| "This is useful for discrete probabilistic models that model binary events " + | ||
| "rather than integer counts. (default: False)", |
There was a problem hiding this comment.
The style seems to be . Default False rather than . (default: False). @BryanCutler@holdenk thoughts?
Though I must say I'd prefer (default: X). across the board myself.
MLnick
commented
Apr 12, 2016
A few minor comments, otherwise LGTM. @holdenk@BryanCutler we could merge this and #12308, and then update the param to be shared (if we can do the different doc thing?). |
yongtang
commented
Apr 12, 2016
Thanks @MLnick I just updated the pull request to address several minor issues. With respect to |
SparkQA
commented
Apr 12, 2016
Test build #55608 has finished for PR 12079 at commit
|
BryanCutler
commented
Apr 12, 2016
I think that will be better and maybe then we can change the param to be shared on both the Scala and Python side. |
holdenk
commented
Apr 12, 2016
@BryanCutler / @yongtang That sounds reasonable :) |
MLnick
commented
Apr 12, 2016
As per @jkbradley's #12308 (comment), let's keep them separate params. |
MLnick
commented
Apr 14, 2016
jenkins retest this please |
What changes were proposed in this pull request?
This fix tries to add binary toggle Param to PySpark HashingTF in ML & MLlib. If this toggle is set, then all non-zero counts will be set to 1.
Note: This fix (SPARK-14238) is extended from SPARK-13963 where Scala implementation was done.
How was this patch tested?
This fix adds two tests to cover the code changes. One for HashingTF in PySpark's ML and one for HashingTF in PySpark's MLLib.