Skip to content
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-29381][PYTHON][ML] Add _ before the XXXParams classes #26103

Closed
wants to merge 1 commit into from

Conversation

huaxingao
Copy link
Contributor

What changes were proposed in this pull request?

Add _ before XXXParams classes to indicate internal usage

Why are the changes needed?

Follow the PEP 8 convention to use _single_leading_underscore to indicate internal use

Does this PR introduce any user-facing change?

No

How was this patch tested?

use existing tests

@SparkQA
Copy link

SparkQA commented Oct 12, 2019

Test build #111976 has finished for PR 26103 at commit 3a5962c.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • class _JavaClassifierParams(HasRawPredictionCol, _JavaPredictorParams):
  • class JavaClassifier(JavaPredictor, _JavaClassifierParams):
  • class JavaClassificationModel(JavaPredictionModel, _JavaClassifierParams):
  • class _JavaProbabilisticClassifierParams(HasProbabilityCol, HasThresholds, _JavaClassifierParams):
  • class JavaProbabilisticClassifier(JavaClassifier, _JavaProbabilisticClassifierParams):
  • class _GBTClassifierParams(_GBTParams, _HasVarianceImpurity):
  • class GBTClassifier(JavaProbabilisticClassifier, _GBTClassifierParams,
  • class _OneVsRestParams(_JavaClassifierParams, HasWeightCol):
  • class OneVsRest(Estimator, _OneVsRestParams, HasParallelism, JavaMLReadable, JavaMLWritable):
  • class OneVsRestModel(Model, _OneVsRestParams, JavaMLReadable, JavaMLWritable):
  • class _JavaPredictorParams(HasLabelCol, HasFeaturesCol, HasPredictionCol):
  • class JavaPredictor(JavaEstimator, _JavaPredictorParams):
  • class JavaPredictionModel(JavaModel, _JavaPredictorParams):

Copy link
Member

@srowen srowen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this affect anyone who has subclassed these quasi-internal classes? I'm trying to figure out how likely it is that this breaks someone's extension vs the value. We can break this in 3.0 but just weigh it against how important it is.

@huaxingao
Copy link
Contributor Author

Almost all of these quasi-internal classes _XXXParams are newly added in these parity jiras with very few exceptions. One of them is LSHParams. If user has subclass this LSHParams, with the name changed to _LSHParams, user has to explicitly import this class like from pyspark.ml.feature import _LSHParamsbecause import * does not import objects whose names start with an underscore.

Copy link
Member

@srowen srowen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems OK pending tests.

@SparkQA
Copy link

SparkQA commented Oct 14, 2019

Test build #4896 has finished for PR 26103 at commit 3a5962c.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • class _JavaClassifierParams(HasRawPredictionCol, _JavaPredictorParams):
  • class JavaClassifier(JavaPredictor, _JavaClassifierParams):
  • class JavaClassificationModel(JavaPredictionModel, _JavaClassifierParams):
  • class _JavaProbabilisticClassifierParams(HasProbabilityCol, HasThresholds, _JavaClassifierParams):
  • class JavaProbabilisticClassifier(JavaClassifier, _JavaProbabilisticClassifierParams):
  • class _GBTClassifierParams(_GBTParams, _HasVarianceImpurity):
  • class GBTClassifier(JavaProbabilisticClassifier, _GBTClassifierParams,
  • class _OneVsRestParams(_JavaClassifierParams, HasWeightCol):
  • class OneVsRest(Estimator, _OneVsRestParams, HasParallelism, JavaMLReadable, JavaMLWritable):
  • class OneVsRestModel(Model, _OneVsRestParams, JavaMLReadable, JavaMLWritable):
  • class _JavaPredictorParams(HasLabelCol, HasFeaturesCol, HasPredictionCol):
  • class JavaPredictor(JavaEstimator, _JavaPredictorParams):
  • class JavaPredictionModel(JavaModel, _JavaPredictorParams):

@srowen
Copy link
Member

srowen commented Oct 14, 2019

Merged to master

@srowen srowen closed this in cfcaf52 Oct 14, 2019
@huaxingao
Copy link
Contributor Author

Thanks a lot! @srowen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants