Github user yanboliang commented on a diff in the pull request:

    https://github.com/apache/spark/pull/6087#discussion_r30382722
  
    --- Diff: python/pyspark/mllib/clustering.py ---
    @@ -166,12 +168,38 @@ class GaussianMixtureModel(object):
         True
         >>> labels[3]==labels[4]
         True
    +    >>> clusterdata_3 = sc.parallelize(data.reshape(15, 1))
    +    >>> im = GaussianMixtureModel([0.5, 0.5],
    +    ...      [MultivariateGaussian(Vectors.dense([-1.0]), DenseMatrix(1, 
1, [1.0])),
    +    ...      MultivariateGaussian(Vectors.dense([1.0]), DenseMatrix(1, 1, 
[1.0]))])
    +    >>> model = GaussianMixture.train(clusterdata_3, 2, initialModel=im)
         """
     
         def __init__(self, weights, gaussians):
    -        self.weights = weights
    -        self.gaussians = gaussians
    -        self.k = len(self.weights)
    +        self._weights = weights
    +        self._gaussians = gaussians
    +        self._k = len(self._weights)
    +
    +    @property
    +    def weights(self):
    +        """
    +        Weights for each Gaussian distribution in the mixture, where 
weights[i]() is
    --- End diff --
    
    Yes, it's typo, let me fix it.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to