- The first input is the true labels of your data,
- The second input is the scores (probabilities) predicted by your model, and
- 'positive' indicates the class with respect to which the output is calculated.
HOW TO CALCULATE AUROC VALUE FOR ANY CLASSIFICATION MODEL?
3 次查看(过去 30 天)
显示 更早的评论
Hi, MATLAB community. Can anyone please help me in calculating AUROC value of SVM classification problem.I have calculated up to ROC plot. The problem starts when i start to working with perfcurve and its input like labels,scores and posclass. And it is also very helpful if anyone say ,how to convert double array to vector of floating points?
0 个评论
采纳的回答
Ayush Aniket
2023-9-28
As per my understanding you have trained your SVM classification model and want to compute the AUROC value using ‘perfcurve’. The inputs to the `perfcurve` function are as follows:
So, if your data has two labels, you must mention which one corresponds to the ‘positive’ level in the third parameter. For better understanding you can refer to the example using the following link:
In the example, ‘fisheriris’ dataset is being used, where ‘true labels’ called species, have two values: ‘versicolor’ and ‘virginica’. When computing the AUC, the labels that corresponds to the ‘positive’ class must be mentioned if it's not already in a binary form (1 and 0) as shown below:
[X,Y,T,AUC] = perfcurve(species(51:end,:),scores,'virginica');
Regarding your second query, in MATLAB, a double array is already a floating-point array. If you have a multi-dimensional double array and you want to convert it into a single-dimensional (vector) array, you can use the `(:)` operator to achieve this as shown below:
vector = doubleArray(:);
This will convert your 2D or multi-dimensional double array into a single-dimensional vector, preserving the floating-point nature of the values. You can read more about how MATLAB stores floating point numbers by referring to the following link:
Hope it helps.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 ROC - AUC 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!