Skip to content

Commit 4af0dc6

Browse files
committed
address comments
1 parent 7acada0 commit 4af0dc6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

python/pyspark/ml/clustering.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,13 @@ def predict(self, value):
163163
"""
164164
return self._call_java("predict", value)
165165

166+
@since("3.0.0")
167+
def predictProbability(self, value):
168+
"""
169+
Predict probability for the given features.
170+
"""
171+
return self._call_java("predictProbability", value)
172+
166173

167174
@inherit_doc
168175
class GaussianMixture(JavaEstimator, GaussianMixtureParams, JavaMLWritable, JavaMLReadable):
@@ -202,6 +209,8 @@ class GaussianMixture(JavaEstimator, GaussianMixtureParams, JavaMLWritable, Java
202209
GaussianMixture...
203210
>>> model.predict(df.head().features)
204211
2
212+
>>> model.predictProbability(df.head().features)
213+
DenseVector([0.0, 0.4736, 0.5264])
205214
>>> model.hasSummary
206215
True
207216
>>> summary = model.summary

0 commit comments

Comments
 (0)