-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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
[SPARK-29377][PYTHON][ML] Parity between Scala ML tuning and Python ML tuning #26057
Conversation
Test build #111911 has finished for PR 26057 at commit
|
@@ -199,7 +181,25 @@ def _to_java_impl(self): | |||
return java_estimator, java_epms, java_evaluator | |||
|
|||
|
|||
class CrossValidator(Estimator, ValidatorParams, HasParallelism, HasCollectSubModels, | |||
class _CrossValidatorParams(_ValidatorParams): |
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.
Will these changes affect users who try to extend these classes much or at all?
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.
I don't think adding leading underscore will affect users to extend these classes. The single leading underscore before a class name is only a weak indicator for internal usage. It doesn't enforce privacy.
retest this please |
Test build #111974 has finished for PR 26057 at commit
|
""" | ||
return self._set(estimatorParamMaps=value) | ||
|
||
def setEvaluator(self, value): |
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.
Do we need to add since for setters? Some like setNumFolds have it, but some do not.
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.
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.
I checked the history, the @since
was removed in #12020. I guess the reason is that in CrossValidator
, the getters/getters have @since 1.4
, but in TrainValidationSplit
, the getters/getters have @since 2.0
. When putting the common getters/setters in ValidatorParams
, neither @since 1.4
nor @since 2.0
is quite right, so @since
was removed. I am facing the same problem. Shall I have @since 2.0
? or just not adding back the @since
?
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.
@since 2.0
is at least accurate, as both have existed since that version. One existed before, sure, but this is maybe not a big deal, as it won't matter much at all to know it was in 1.x.
Test build #112000 has finished for PR 26057 at commit
|
merged to master, thanks all |
@zhengruifeng @viirya @srowen Thanks all for your help! |
What changes were proposed in this pull request?
Follow Scala ml tuning implementation
ValidatorParams
to indicate private_CrossValidatorParams
and_TrainValidationSplitParams
Why are the changes needed?
Keep parity between scala and python
Does this PR introduce any user-facing change?
add
CrossValidatorModel.getNumFolds
andTrainValidationSplitModel.getTrainRatio()
How was this patch tested?
Add doctest