//使用推荐模型对用户商品进行预测评分,得到预测评分的数据集
var predictions = model.predict(usersProducts).map {
case Rating(user, product, rate) =>
((user, product), rate)
}
predictions.count //Long = 1000209
//将真实评分数据集与预测评分数据集进行合并
val ratesAndPreds = ratings.map {
case Rating(user, product, rate) =>
((user, product), rate)
}.join(predictions)
ratesAndPreds.count //Long = 1000209
楼主,这俩个 .count一直在报错。请问楼主遇到过吗? |