Github user mengxr commented on a diff in the pull request:
https://github.com/apache/spark/pull/6499#discussion_r32784727
--- Diff: python/pyspark/mllib/clustering.py ---
@@ -264,6 +270,190 @@ def train(cls, rdd, k, convergenceTol=1e-3,
maxIterations=100, seed=None, initia
return GaussianMixtureModel(weight, mvg_obj)
+class StreamingKMeansModel(KMeansModel):
+ """
+ .. note:: Experimental
+ Clustering model which can perform an online update of the centroids.
+
+ The update formula for each centroid is given by
+ c_t+1 = [(c_t * n_t * a) + (x_t * m_t)] / [n_t + m_t]
+ n_t+1 = n_t * a + m_t
+
+ where
+ c_t: Centroid at the n_th iteration.
--- End diff --
Please run `make html` under `python/docs` and checkout the generated html
files. I got some warnings:
~~~
/Users/meng/src/spark/python/pyspark/mllib/clustering.py:docstring of
pyspark.mllib.clustering.StreamingKMeansModel:2: WARNING: Explicit markup ends
without a blank line; unexpected unindent.
/Users/meng/src/spark/python/pyspark/mllib/clustering.py:docstring of
pyspark.mllib.clustering.StreamingKMeansModel:11: ERROR: Unexpected indentation.
/Users/meng/src/spark/python/pyspark/mllib/clustering.py:docstring of
pyspark.mllib.clustering.StreamingKMeansModel:12: WARNING: Block quote ends
without a blank line; unexpected unindent.
~~~
Also the generated doc doesn't show a list of bullets here. Please check
sphinx doc. Btw, we don't recommend vertical alignment, because it is hard to
update.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]