使用 Pyspark 进行交叉验证

时间:2021-01-18 20:38:53

标签: apache-spark pyspark

我正在尝试在使用 spark 时使用交叉验证,但它引发错误:

Add a default splash screen to this plug-in

IllegalArgumentException:标签不存在。可用:event_type_str,event_team,shot_place_str,location_str,assist_method_str,situation_str,COUNTRY_CODE,is_goal,event_type_str_idx,event_team_idx,shot_place_str_idx,location_str_idx,assist_method_str_idx,situation_str_idx,country_code_idx,event_type_str_vec,event_team_vec,shot_place_str_vec,location_str_vec,assist_method_str_vec,situation_str_vec,country_code_vec,功能,CrossValidator_2fc516202d9d_rand, rawPrediction、概率、预测

[这是我的特征的样子1

1 个答案:

答案 0 :(得分:0)

默认情况下,您的 BinaryClassificationEvaluator 期望标签列名为 label,正如您从文档 https://spark.apache.org/docs/latest/api/python/pyspark.ml.html#pyspark.ml.evaluation.BinaryClassificationEvaluator 中看到的那样。 您需要根据数据框中给出的列指定 rawPredictionCollabelCol