提取参数
您已经在 msd 数据集上测试了 192 个不同的模型,并找到了最优的 ROEM 及其对应的模型(模型 38)。
现在需要提取该模型的超参数。这里提供了您之前创建的 model_list,其中包含您生成的全部 192 个模型。请按以下说明提取超参数。
本练习是课程的一部分
使用 PySpark 构建推荐引擎
练习说明
- 使用列表切片从模型列表中取出第 38 个模型。将该模型命名为
best_model。 - 使用
.get____()方法提取以下超参数的取值:RankMaxIterRegParamAlpha
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Extract the best_model
best_model = ____[____]
# Extract the Rank
print ("Rank: ", best_model.get___())
# Extract the MaxIter value
print ("MaxIter: ", ____.get____())
# Extract the RegParam value
print ("RegParam: ", best_model.____())
# Extract the Alpha value
print ("Alpha: ", ____.____())