Skip to content

Commit 04214d9

Browse files
committed
more pyspark magic vals
1 parent e05a035 commit 04214d9

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

python/pyspark/mllib/recommendation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,12 @@ class MatrixFactorizationModel(JavaModelWrapper, JavaSaveable, JavaLoader):
101101
102102
>>> model = ALS.train(ratings, 1, nonnegative=True, seed=10)
103103
>>> model.predict(2, 2)
104-
3.8...
104+
3.73...
105105
106106
>>> df = sqlContext.createDataFrame([Rating(1, 1, 1.0), Rating(1, 2, 2.0), Rating(2, 1, 2.0)])
107107
>>> model = ALS.train(df, 1, nonnegative=True, seed=10)
108108
>>> model.predict(2, 2)
109-
3.8...
109+
3.73...
110110
111111
>>> model = ALS.trainImplicit(ratings, 1, nonnegative=True, seed=10)
112112
>>> model.predict(2, 2)

python/pyspark/sql/dataframe.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ def sample(self, withReplacement, fraction, seed=None):
436436
"""Returns a sampled subset of this :class:`DataFrame`.
437437
438438
>>> df.sample(False, 0.5, 42).count()
439-
1
439+
2
440440
"""
441441
assert fraction >= 0.0, "Negative fraction value: %s" % fraction
442442
seed = seed if seed is not None else random.randint(0, sys.maxsize)
@@ -463,8 +463,8 @@ def sampleBy(self, col, fractions, seed=None):
463463
+---+-----+
464464
|key|count|
465465
+---+-----+
466-
| 0| 3|
467-
| 1| 8|
466+
| 0| 5|
467+
| 1| 9|
468468
+---+-----+
469469
470470
"""

0 commit comments

Comments
 (0)