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-24439][ML][PYTHON]Add distanceMeasure to BisectingKMeans in PySpark #21557

Closed
wants to merge 2 commits into from

Conversation

huaxingao
Copy link
Contributor

What changes were proposed in this pull request?

add distanceMeasure to BisectingKMeans in Python.

How was this patch tested?

added doctest and also manually tested it.

@SparkQA
Copy link

SparkQA commented Jun 13, 2018

Test build #91788 has finished for PR 21557 at commit 7f4cb61.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • class KMeans(JavaEstimator, HasDistanceMeasure, HasFeaturesCol, HasPredictionCol, HasMaxIter,
  • class BisectingKMeans(JavaEstimator, HasDistanceMeasure, HasFeaturesCol, HasPredictionCol,
  • class HasDistanceMeasure(Params):

Copy link
Member

@BryanCutler BryanCutler left a comment

Choose a reason for hiding this comment

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

Thanks @huaxingao , looks pretty good! I think we just needs to overload the set/get methods in BisectingKMeans and add the since decorator

"""
setParams(self, featuresCol="features", predictionCol="prediction", maxIter=20, \
seed=None, k=4, minDivisibleClusterSize=1.0)
seed=None, k=4, minDivisibleClusterSize=1.0, distanceMeasure="euclidean")
Sets params for BisectingKMeans.
Copy link
Member

Choose a reason for hiding this comment

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

I know we already have setDistanceMeasure and getDistanceMeasure methods from the shared param, but can you also add them here so we can use the since decorator? (same as KMeans)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@BryanCutler Thank you very much for your review. I will make change.

@SparkQA
Copy link

SparkQA commented Jun 28, 2018

Test build #92404 has finished for PR 21557 at commit 7ca733b.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

Copy link
Member

@BryanCutler BryanCutler left a comment

Choose a reason for hiding this comment

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

LGTM

@BryanCutler
Copy link
Member

merged to master, thanks @huaxingao !

@asfgit asfgit closed this in 2224861 Jun 28, 2018
@huaxingao
Copy link
Contributor Author

Thank you very much for your help! @BryanCutler

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

Successfully merging this pull request may close these issues.

3 participants