-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-21388][ML][PySpark] GBTs inherit from HasStepSize & LInearSVC from HasThreshold #18612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Test build #79557 has finished for PR 18612 at commit
|
|
Test build #79560 has finished for PR 18612 at commit
|
| final val threshold: DoubleParam = new DoubleParam(this, "threshold", "threshold in binary classification prediction, in range [0, 1]", ParamValidators.inRange(0, 1)) | ||
| val threshold: DoubleParam = new DoubleParam(this, "threshold", "threshold in binary classification prediction, in range [0, 1]", ParamValidators.inRange(0, 1)) | ||
|
|
||
| setDefault(threshold, 0.5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the error can be eliminated after removing this line, and actually we should set default value in the concrete class if it's inherited.
|
Test build #79652 has finished for PR 18612 at commit
|
|
So improving the doc certainly makes sense on the Python side (thank you for catching that). But as @MLnick asked on the JIRA - I'm not super sure I see the point of the refactor on the Scala side. If we have a parameter with the same name but a different meaning why mix in a base trait only to override its only meaningful provided value? What do you think @jkbradley? |
|
@holdenk I think the meaning of |
|
It makes sense for As for GBT, well I am sort of indifferent as the step size is roughly analogous between the two definitions (in both cases it is a learning rate). |
|
Test build #79897 has finished for PR 18612 at commit
|
python/pyspark/ml/feature.py
Outdated
|
|
||
| @inherit_doc | ||
| class Binarizer(JavaTransformer, HasInputCol, HasOutputCol, JavaMLReadable, JavaMLWritable): | ||
| class Binarizer(JavaTransformer, HasInputCol, HasOutputCol, HasThreshold, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also needs to be reverted.
| kwargs = self._input_kwargs | ||
| return self._set(**kwargs) | ||
|
|
||
| @since("1.4.0") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and similarly here, added back
|
Test build #80001 has finished for PR 18612 at commit
|
yanboliang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Merged into master, thanks for all. |
What changes were proposed in this pull request?
GBTs inherit from HasStepSize & LInearSVC/Binarizer from HasThreshold
How was this patch tested?
existing tests