Pyspark ALS建议所有用户使用().first()挂起

2024-04-26 20:42:10 发布

您现在位置:Python中文网/ 问答频道 /正文

我创建了一个ALS模型,并调用了它的方法.transform(test_data)。我现在要查看为数据生成的预测。在

userRecs.printSchema()产生:

 |-- ProductID: integer (nullable = false)
 |-- recommendations: array (nullable = true)
 |    |-- element: struct (containsNull = true)
 |    |    |-- CustomerID: integer (nullable = true)
 |    |    |-- rating: float (nullable = true)

调用userRecs.first()会导致进程挂起在“阶段4”

[Stage 4:> (0 + 1) / 1]

我是否处理/读取数据不正确?我也不知道为什么调用userRecs.first()需要更多的处理?在

^{pr2}$

另外,我想知道是否有另一种方法可以让模型为单个数据点提供预测? 我相信有更好的方法来预测某个值)?在


Tags: 数据方法模型testfalsetruedatatransform