How to plot roc and find pfa

19 ビュー (過去 30 日間)
Praanesh Sambath
Praanesh Sambath 2020 年 8 月 3 日
回答済み: Soumya 2025 年 6 月 20 日 10:34
I have a radar data of size 55*12 with SNR 14db. How do I plot ROC for this data.
Any help is appreciated. Thanks in advance.

回答 (1 件)

Soumya
Soumya 2025 年 6 月 20 日 10:34
You can plot the ROC curve and evaluate classifier performance for radar data using the ‘perfcurve’ function. The ‘perfcurve’ function returns the properties of an ROC curve for a vector of classifier predictions, scores, given true class labels, labels, and the positive class label. The computed values from the function can then be used to visualize the ROC curve using the ‘plot’ function.
The following steps can be used to plot the ROC curve:
  • Create a matrix of predictor variables and define the binary response variable:
X = radarData;
labels = [ones(30,1); zeros(25,1)];
  • Use a suitable classifier that can output scores or probabilities. Following is an example with logistic regression:
mdl = fitglm(X, Y, 'Distribution', 'binomial', 'Link', 'logit');
scores = mdl.Fitted.Probability;
  • Compute the parameter of the ROC curve using the ‘perfcurve’ function:
[X_out, Y_out, T, AUC] = perfcurve(labels, scores, 1);
  • Plot the ROC curve:
plot(X_out, Y_out);
xlabel('False Positive Rate');
ylabel('True Positive Rate');
The following output ROC curve is received by following the given steps:
To find the probability of false alarm (PFA) at a desired level, you can search the ROC curve for the closest false positive rate to your target. You can find the PFA using the following code snippet:
desiredPFA = 0.05;
[~, idx] = min(abs(X_out - desiredPFA));
pfa = X_out(idx);
disp(pfa);
Since, you have the SNR data, you can consider using the ‘rocsnr’ to calculate the PFA:
[Pd,Pfa] = rocsnr(SNR);
[~, idx] = min(abs(Pd - desiredPd));
pfa_at_desiredPd = Pfa(idx);
Please refer to the following documentations to get more information on the related functions:
I hope this helps!

カテゴリ

Help Center および File ExchangeDetection についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by