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:
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.