pyspark 出现pyspark.sql.utils.IllegalArgumentException: 'requirement failed: Column prediction must be of type double but was actually float.'异常

在pyspark的交互式环境下调用pysark.ml中的MulticlassClassificationEvaluator执行下列命令做评估时会出现下面那个问题,但在代码中通过spark-submit提交时则可以正常运行。

from pyspark.ml.evaluation import  MulticlassClassificationEvaluator
evaluatorMC = MulticlassClassificationEvaluator().setLabelCol("score").setPredictionCol("prediction")
Accuracy = evaluator.evaluate(predictions)

pyspark 出现pyspark.sql.utils.IllegalArgumentException: 'requirement failed: Column prediction must be of type double but was actually float.'异常_第1张图片

 

你可能感兴趣的:(pyspark 出现pyspark.sql.utils.IllegalArgumentException: 'requirement failed: Column prediction must be of type double but was actually float.'异常)