Skip to content

Commit 57e5200

Browse files
committed
address comments
1 parent 06140a4 commit 57e5200

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/mllib-collaborative-filtering.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ We use the default ALS.train() method which assumes ratings are explicit. We eva
201201
recommendation by measuring the Mean Squared Error of rating prediction.
202202

203203
{% highlight python %}
204-
from pyspark.mllib.recommendation import ALS, Rating
204+
from pyspark.mllib.recommendation import ALS, MatrixFactorizationModel, Rating
205205

206206
# Load and parse the data
207207
data = sc.textFile("data/mllib/als/test.data")
@@ -220,7 +220,7 @@ MSE = ratesAndPreds.map(lambda r: (r[1][0] - r[1][1])**2).reduce(lambda x, y: x
220220
print("Mean Squared Error = " + str(MSE))
221221

222222
# Save and load model
223-
model.save("myModelPath")
223+
model.save(sc, "myModelPath")
224224
sameModel = MatrixFactorizationModel.load(sc, "myModelPath")
225225
{% endhighlight %}
226226

0 commit comments

Comments
 (0)