You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by thunterdb <gi...@git.apache.org> on 2016/01/05 19:47:26 UTC

[GitHub] spark pull request: [SPARK-12006][ML][PYTHON] Fix GMM failure if i...

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

    https://github.com/apache/spark/pull/9986#discussion_r48880089
  
    --- Diff: python/pyspark/mllib/clustering.py ---
    @@ -346,7 +346,7 @@ def train(cls, rdd, k, convergenceTol=1e-3, maxIterations=100, seed=None, initia
                 if initialModel.k != k:
                     raise Exception("Mismatched cluster count, initialModel.k = %s, however k = %s"
                                     % (initialModel.k, k))
    -            initialModelWeights = initialModel.weights
    +            initialModelWeights = [w for w in initialModel.weights]
    --- End diff --
    
    Instead of doing this, I suggest you explicitly call `list(initialModel.weights)`, it is easier to understand.


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

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