diff options
author | Hrishikesh Subramonian <hrishikesh.subramonian@flytxt.com> | 2015-05-05 07:57:39 -0700 |
---|---|---|
committer | Xiangrui Meng <meng@databricks.com> | 2015-05-05 07:57:39 -0700 |
commit | 5995ada96b661546a80657f2c5ed20604593e4aa (patch) | |
tree | 5ea7879e611aa34fd912d93e253ad69d0799a665 /examples/src/main | |
parent | 5ab652cdb8bef10214edd079502a7f49017579aa (diff) | |
download | spark-5995ada96b661546a80657f2c5ed20604593e4aa.tar.gz spark-5995ada96b661546a80657f2c5ed20604593e4aa.tar.bz2 spark-5995ada96b661546a80657f2c5ed20604593e4aa.zip |
[SPARK-6612] [MLLIB] [PYSPARK] Python KMeans parity
The following items are added to Python kmeans:
kmeans - setEpsilon, setInitializationSteps
KMeansModel - computeCost, k
Author: Hrishikesh Subramonian <hrishikesh.subramonian@flytxt.com>
Closes #5647 from FlytxtRnD/newPyKmeansAPI and squashes the following commits:
b9e451b [Hrishikesh Subramonian] set seed to fixed value in doc test
5fd3ced [Hrishikesh Subramonian] doc test corrections
20b3c68 [Hrishikesh Subramonian] python 3 fixes
4d4e695 [Hrishikesh Subramonian] added arguments in python tests
21eb84c [Hrishikesh Subramonian] Python Kmeans - setEpsilon, setInitializationSteps, k and computeCost added.
Diffstat (limited to 'examples/src/main')
-rwxr-xr-x | examples/src/main/python/mllib/kmeans.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/examples/src/main/python/mllib/kmeans.py b/examples/src/main/python/mllib/kmeans.py index f901a87fa6..002fc75799 100755 --- a/examples/src/main/python/mllib/kmeans.py +++ b/examples/src/main/python/mllib/kmeans.py @@ -43,4 +43,5 @@ if __name__ == "__main__": k = int(sys.argv[2]) model = KMeans.train(data, k) print("Final centers: " + str(model.clusterCenters)) + print("Total Cost: " + str(model.computeCost(data))) sc.stop() |