PySpark中的多类分类评估器

时间:2018-10-13 06:08:30

标签: pyspark

from pyspark.ml.classification import MultilayerPerceptronClassifier
inputneurons = len(pipe_df.columns)
nn = MultilayerPerceptronClassifier(layers = [inputneurons,20,2])
nn_model = nn.fit(train_data)
results = nn_model.transform(test_data)
from pyspark.ml.evaluation import MulticlassClassificationEvaluator
evaluator = MulticlassClassificationEvaluator()
mlp_accuracy = evaluator.evaluate(results)

并在运行时显示错误---------------------------------------- ----------------------------------- Py4JJavaError追溯(最近一次调用)  在()中      23评估者= MulticlassClassificationEvaluator()      24 ---> 25 mlp_accuracy = evaluator.evaluate(结果)      26      27

,我尝试了BinaryClassificationEvaluator,但效果不佳。 有人知道这是怎么回事吗?我是PySpark的新手...

0 个答案:

没有答案