machine-learning - 在 Spark : MatrixFactorizationModel. scala “recommendProductsForUsers” 函数中需要很长时间才能完成

标签 machine-learning apache-spark-mllib recommendation-engine data-science

我有 9 个节点集群,每个节点都有以下配置,

enter image description here

enter image description here

我正在尝试使用 ' recommendProductsForUsers 为 MatrixFactorizationModel 中的所有用户生成建议' 功能。看起来需要很长时间才能完成(例如:对于 1 个月的数据,大约需要 34 小时左右)。是不是因为对矩阵进行了多次迭代?

如何减少执行时间?

这些是我的 Spark 提交配置:

spark-submit --jars $JAR_LOC --class com.collaborativefiltering.CustomerCollaborativeJob --driver-memory 5G --num-executors 7 --executor-cores 2 --executor-memory 20G --master yarn-client cust_rec/cust-rec.jar --period 1month --out /PATH --rank 50 --numIterations 2 --lambda 0.25 --alpha 300 --topK 20

提前非常感谢您。

最佳答案

我发现在 MatrixFactorizationModel 中,recommendProductsForUsers 会经历多次迭代,因此计算时间很长。一旦我开始在云中运行我的作业,我就通过增加节点和 Spark 执行器来测试作业。它确实有效!我能够在 4 小时内运行并完成这项工作。

关于machine-learning - 在 Spark : MatrixFactorizationModel. scala “recommendProductsForUsers” 函数中需要很长时间才能完成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41424332/

相关文章:

opencv - 用于图像分类的神经网络 (OpenCV/Emgu)

java - 无法在代码中向spark-cluster提交应用程序

apache-spark - 为什么 StandardScaler 不将元数据附加到输出列?

python - Pandas 值(value)错误: Cannot set a frame with no defined index and a value that cannot be converted to a Series

tensorflow - 在 GPU 支持下对高维数据进行更快的 Kmeans 聚类

machine-learning - ValueError : The name "Sequential" is used 4 times in the model. 所有图层名称都应该是唯一的吗?

artificial-intelligence - 神经网络推荐引擎

mysql - Apache mahout 评估速度极慢 - 使用修改后的 NearestNUserNeighborhoud

machine-learning - 机器学习 - 感知器

python - Spark(Python)中的 Kolmogorov Smirnov 测试不起作用?