MATLAB code to compute precision and recall
Versione 1.0.0 (1,36 KB) da
Mehdi Ghasri
This is a MATLAB code that computes the precision and recall between the true and predicted values of a classification problem.
This is a MATLAB code that computes the precision and recall between the true and predicted values of a classification problem.
The code then defines the true and predicted values as two binary arrays y_true and y_pred.
Next, the code counts the number of true positives (tp), false positives (fp), and false negatives (fn) by comparing the elements of y_true and y_pred.
The code then computes the precision and recall as the ratio of true positives to the sum of true positives and false positives (for precision) and the sum of true positives and false negatives (for recall), respectively.
Finally, the code displays the precision and recall using the disp function.
Cita come
Mehdi Ghasri (2024). MATLAB code to compute precision and recall (https://www.mathworks.com/matlabcentral/fileexchange/133137-matlab-code-to-compute-precision-and-recall), MATLAB Central File Exchange. Recuperato .
Compatibilità della release di MATLAB
Creato con
R2023a
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS LinuxTag
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Scopri Live Editor
Crea script con codice, output e testo formattato in un unico documento eseguibile.
Versione | Pubblicato | Note della release | |
---|---|---|---|
1.0.0 |