Skip to content

Commit

Permalink
overload the set/getDistanceMeasure methods in BisectingKMeans
Browse files Browse the repository at this point in the history
  • Loading branch information
huaxingao committed Jun 28, 2018
1 parent 7f4cb61 commit 7ca733b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions python/pyspark/ml/clustering.py
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,20 @@ def getMinDivisibleClusterSize(self):
"""
return self.getOrDefault(self.minDivisibleClusterSize)

@since("2.4.0")
def setDistanceMeasure(self, value):
"""
Sets the value of :py:attr:`distanceMeasure`.
"""
return self._set(distanceMeasure=value)

@since("2.4.0")
def getDistanceMeasure(self):
"""
Gets the value of `distanceMeasure` or its default value.
"""
return self.getOrDefault(self.distanceMeasure)

def _create_model(self, java_model):
return BisectingKMeansModel(java_model)

Expand Down

0 comments on commit 7ca733b

Please sign in to comment.