Skip to content

Commit 1f8c11e

Browse files
committed
Add more examples
1 parent 9a4fd40 commit 1f8c11e

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

examples/src/main/python/mllib/bisecting_k_means_example.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@
4040
# Evaluate clustering
4141
cost = model.computeCost(parsedData)
4242
print("Bisecting K-means Cost = " + str(cost))
43-
44-
# Save and load model
45-
path = "target/org/apache/spark/PythonBisectingKMeansExample/BisectingKMeansModel"
46-
model.save(sc, path)
47-
sameModel = BisectingKMeansModel.load(sc, path)
4843
# $example off$
4944

5045
sc.stop()

examples/src/main/python/mllib/elementwise_product_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
print(each)
4646

4747
print("transformedData2:")
48-
for each in transformedData2.collect():
48+
for each in transformedData2:
4949
print(each)
5050

5151
sc.stop()

examples/src/main/python/status_api_demo.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@
1919

2020
import time
2121
import threading
22-
import Queue
22+
import sys
23+
if sys.version >= '3':
24+
import queue as Queue
25+
else:
26+
import Queue
2327

2428
from pyspark import SparkConf, SparkContext
2529

0 commit comments

Comments
 (0)