MATLAB中的二进制分类器的ROC曲线 [英] ROC curve for a binary classifier in MATLAB

查看:458
本文介绍了MATLAB中的二进制分类器的ROC曲线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个二进制分类器,如果输入X的预测值低于某个阈值(例如T),则将其分类为零类,否则将其分类为零.
我对每个输入都具有所有预测值和实际值.这样我就可以同时拥有输入的预测类和实际类.

现在,我想使用MATLAB对该分类器进行ROC曲线绘制.我该怎么办?

解决方案

使用 perfcurve :

[X,Y] = perfcurve(labels,scores,posclass);
plot(X,Y);

labels是数据的真实标签,scores是分类器的输出得分(在阈值之前),posclass是标签中的正分类.

I have a binary classifier, which classifies an input X as class zero if its predicted value is below some threshold (say T), and one otherwise.
I have all predicted and actual values for every input. So I can have both predicted class and actual class of an input.

Now I want to have the ROC curve for this classifier with MATLAB. How should I do it?

解决方案

Use perfcurve:

[X,Y] = perfcurve(labels,scores,posclass);
plot(X,Y);

labels are the true labels of the data, scores are the output scores from your classifier (before the threshold) and posclass is the positive class in your labels.

这篇关于MATLAB中的二进制分类器的ROC曲线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆