HOW TO CALCULATE AUROC VALUE FOR ANY CLASSIFICATION MODEL?

2 次查看(过去 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?

采纳的回答

Ayush Aniket
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:
  • 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.
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 个)

类别

Help CenterFile Exchange 中查找有关 ROC - AUC 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by