Skip to content

Commit a3598a1

Browse files
committed
fix
1 parent b9f54a1 commit a3598a1

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

python/pyspark/mllib/classification.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,10 @@ class NaiveBayesModel(Saveable, Loader["NaiveBayesModel"]):
776776
>>> path = tempfile.mkdtemp()
777777
>>> model.save(sc, path)
778778
>>> sameModel = NaiveBayesModel.load(sc, path)
779-
>>> bool(sameModel.predict(SparseVector(2, {0: 1.0})) == model.predict(SparseVector(2, {0: 1.0})))
779+
>>> bool((
780+
... sameModel.predict(SparseVector(2, {0: 1.0})) ==
781+
... model.predict(SparseVector(2, {0: 1.0}))
782+
... ))
780783
True
781784
>>> from shutil import rmtree
782785
>>> try:

python/pyspark/mllib/feature.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,9 +554,9 @@ class PCA:
554554
... Vectors.dense([4.0, 0.0, 0.0, 6.0, 7.0])]
555555
>>> model = PCA(2).fit(sc.parallelize(data))
556556
>>> pcArray = model.transform(Vectors.sparse(5, [(1, 1.0), (3, 7.0)])).toArray()
557-
>>> pcArray[0]
557+
>>> float(pcArray[0])
558558
1.648...
559-
>>> pcArray[1]
559+
>>> float(pcArray[1])
560560
-4.013...
561561
"""
562562

0 commit comments

Comments
 (0)