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.'异常

 

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

上一篇:Oracle第五周测验


下一篇:sql示例