You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by rmchurch <gi...@git.apache.org> on 2017/03/30 17:47:07 UTC

[GitHub] spark issue #11515: [SPARK-13672] [ML] Add python examples of BisectingKMean...

Github user rmchurch commented on the issue:

    https://github.com/apache/spark/pull/11515
  
    This example doesn't seem to work in Spark 2.0.0, and from the master mllib/clustering.py, I don't expect it to work in the most updated code either. Specifically, the Python BisectingKMeansModel class does not have a save method (the KMeansModel class does), so that the last three lines of the following code do not work:
    
    ```
    # Build the model (cluster the data)
    model = BisectingKMeans.train(parsedData, 2, maxIterations=5)
    
    # Evaluate clustering
    cost = model.computeCost(parsedData)
    print("Bisecting K-means Cost = " + str(cost))
    
    # Save and load model
    path = "target/org/apache/spark/PythonBisectingKMeansExample/BisectingKMeansModel"
    model.save(sc, path)
    sameModel = BisectingKMeansModel.load(sc, path)
    ```


---
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