Uh oh!
There was an error while loading. Please reload this page.
[SPARK-18366][PYSPARK][ML] Add handleInvalid to Pyspark for QuantileDiscretizer and Bucketizer - #15817
[SPARK-18366][PYSPARK][ML] Add handleInvalid to Pyspark for QuantileDiscretizer and Bucketizer#15817techaddict wants to merge 15 commits into
Conversation
SparkQA
commented
Nov 9, 2016
Test build #68378 has finished for PR 15817 at commit
|
MLnick
left a comment
There was a problem hiding this comment.
A few minor things, otherwise looks good.
| handleInvalid="error"): | ||
| """ | ||
| __init__(self, numBuckets=2, inputCol=None, outputCol=None, relativeError=0.001) | ||
| __init__(self, numBuckets=2, inputCol=None, outputCol=None, relativeError=0.001, |
There was a problem hiding this comment.
I think this needs to be
__init__(self, numBuckets=2, inputCol=None, outputCol=None, relativeError=0.001, \
handleInvalid="error")
for API doc formatting
| @since("2.0.0") | ||
| def setParams(self, numBuckets=2, inputCol=None, outputCol=None, relativeError=0.001): | ||
| def setParams(self, numBuckets=2, inputCol=None, outputCol=None, relativeError=0.001, | ||
| handleInvalid="error"): |
There was a problem hiding this comment.
missing handleInvalid in doc string below.
| @keyword_only | ||
| @since("1.4.0") | ||
| def setParams(self, splits=None, inputCol=None, outputCol=None): | ||
| def setParams(self, splits=None, inputCol=None, outputCol=None, handleInvalid="error"): |
There was a problem hiding this comment.
Missing handleInvalid in doc string below.
SparkQA
commented
Nov 11, 2016
Test build #68525 has finished for PR 15817 at commit
|
| typeConverter=TypeConverters.toListFloat) | ||
| handleInvalid = Param(Params._dummy(), "handleInvalid", "how to handle invalid entries. " + | ||
| "Options are skip (filter out rows with invalid values), " + |
There was a problem hiding this comment.
can we put the options in single quotes, e.g. "Options are 'skip' ..."
There was a problem hiding this comment.
@techaddict I don't think you addressed this comment?
There was a problem hiding this comment.
To be fair we don't have it quoted in the scala param description, so if we want to make this change we should probably also change it in the scala side just for consistencies sake.
There was a problem hiding this comment.
Yeah it's pretty minor. Maybe we can do it later in a follow up
There was a problem hiding this comment.
Cool, since we've already cut RC1 and it would be nice to have these params in sooner rather than later and @techaddict seems to be a bit busy I've created a follow up JIRA ( SPARK-18628 ) for this so that we can maybe move ahead with this as is.
| ... inputCol="values", outputCol="buckets", relativeError=0.01, handleInvalid="error") | ||
| >>> qds.getRelativeError() | ||
| 0.01 | ||
| >>> qds.getHandleInvalid() |
There was a problem hiding this comment.
We didn't add anything to the doctest of bucketizer. Actually, I think it would be nice in both places to set handleInvalid='skip' and then add an invalid value to the example data. That way we can show what we mean by invalid and prove that it works.
SparkQA
commented
Nov 11, 2016
Test build #68534 has finished for PR 15817 at commit
|
Can you please add "[ML]" to the PR title? Thanks! |
jkbradley
commented
Nov 15, 2016
Can you please implement the Param directly in Bucketizer and QuantileDiscretizer? Just like in Scala, HasHandleInvalid has built-in Param doc which applies to existing use cases but not Bucketizer and QuantileDiscretizer. It will be better to copy the Param, setter, and getter into Bucketizer and QuantileDiscretizer so that we can specialize the built-in Param doc. |
techaddict
commented
Nov 15, 2016
@jkbradley done 👍 |
SparkQA
commented
Nov 15, 2016
Test build #68649 has finished for PR 15817 at commit
|
techaddict
commented
Nov 24, 2016
ping @davies@jkbradley |
holdenk
commented
Nov 26, 2016
Thanks for working on this @techaddict - one super minor point , but could you also maybe update the PR description to mention the testing is done with new doctests? This is really minor but for people skimming the changelog the PR description will end up as the commit message. |
holdenk
commented
Nov 28, 2016
MLnick
commented
Nov 29, 2016
Jenkins retest this please |
SparkQA
commented
Nov 29, 2016
Test build #69331 has finished for PR 15817 at commit
|
holdenk
commented
Nov 29, 2016
LGTM given our planned follow up to update the documentation for both Python and Scala. |
…iscretizer and Bucketizer ## What changes were proposed in this pull request? added the new handleInvalid param for these transformers to Python to maintain API parity. ## How was this patch tested? existing tests testing is done with new doctests Author: Sandeep Singh <sandeep@techaddict.me> Closes#15817 from techaddict/SPARK-18366. (cherry picked from commit fe854f2) Signed-off-by: Nick Pentreath <nickp@za.ibm.com>
MLnick
commented
Nov 30, 2016
Sorry for delay - this LGTM. Given it's been around for a while and given RC2 is likely to be cut, I've gone ahead and merged to master / branch-2.1. Thanks! |
…iscretizer and Bucketizer ## What changes were proposed in this pull request? added the new handleInvalid param for these transformers to Python to maintain API parity. ## How was this patch tested? existing tests testing is done with new doctests Author: Sandeep Singh <sandeep@techaddict.me> Closesapache#15817 from techaddict/SPARK-18366.
…iscretizer and Bucketizer ## What changes were proposed in this pull request? added the new handleInvalid param for these transformers to Python to maintain API parity. ## How was this patch tested? existing tests testing is done with new doctests Author: Sandeep Singh <sandeep@techaddict.me> Closesapache#15817 from techaddict/SPARK-18366.
What changes were proposed in this pull request?
added the new handleInvalid param for these transformers to Python to maintain API parity.
How was this patch tested?
existing tests
testing is done with new doctests