You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by Lan Jiang <la...@gmail.com> on 2017/05/11 14:31:16 UTC

BinaryClassificationMetrics only supports AreaUnderPR and AreaUnderROC?

I realized that in the Spark ML, BinaryClassifcationMetrics only supports
AreaUnderPR and AreaUnderROC. Why is that? I

What if I need other metrics such as F-score, accuracy? I tried to use
MulticlassClassificationEvaluator to evaluate other metrics such as
Accuracy for a binary classification problem and it seems working. But I am
not sure if there is any issue using MulticlassClassificationEvaluator for
a binary classification. According to the Spark ML documentation "The
Evaluator can be a RegressionEvaluator for regression problems, *a
BinaryClassificationEvaluator for binary data, or a
MulticlassClassificationEvaluator for multiclass problems*. "

https://spark.apache.org/docs/2.1.0/ml-tuning.html

Can someone shed some lights on the issue?

Lan

Re: BinaryClassificationMetrics only supports AreaUnderPR and AreaUnderROC?

Posted by Yanbo Liang <yb...@gmail.com>.
Yeah, for binary data, you can also use MulticlassClassificationEvaluator
to evaluate other metrics which BinaryClassificationEvaluator doesn't
cover, such as accuracy, f1, weightedPrecision and weightedRecall.

Thanks
Yanbo

On Thu, May 11, 2017 at 10:31 PM, Lan Jiang <la...@gmail.com> wrote:

> I realized that in the Spark ML, BinaryClassifcationMetrics only supports
> AreaUnderPR and AreaUnderROC. Why is that? I
>
> What if I need other metrics such as F-score, accuracy? I tried to use
> MulticlassClassificationEvaluator to evaluate other metrics such as
> Accuracy for a binary classification problem and it seems working. But I am
> not sure if there is any issue using MulticlassClassificationEvaluator
> for a binary classification. According to the Spark ML documentation "The
> Evaluator can be a RegressionEvaluator for regression problems, *a
> BinaryClassificationEvaluator for binary data, or a
> MulticlassClassificationEvaluator for multiclass problems*. "
>
> https://spark.apache.org/docs/2.1.0/ml-tuning.html
>
> Can someone shed some lights on the issue?
>
> Lan
>