I keep getting error using plot not enough input arguments.

조회 수: 2 (최근 30일)
Adrian Kleffler
Adrian Kleffler 2023년 5월 4일
댓글: Adrian Kleffler 2023년 5월 4일
I keep getting error when I try to plot the following code and I don't really know what to do.
figure
plot(recall,precision)
xlabel("Recall")
ylabel("Precision")
grid on
title(sprintf("Average Precision = %.2f",ap))
Error using plot
Not enough input arguments.
  댓글 수: 3
Adrian Kleffler
Adrian Kleffler 2023년 5월 4일
[ap,recall,precision] = evaluateDetectionPrecision(detectionResults,testData);
like this
Adrian Kleffler
Adrian Kleffler 2023년 5월 4일
i improved the code to something like this :
recallv = cell2mat(recall);
precisionv = cell2mat(precision);
figure
plot(recallv,precisionv)
xlabel("Recall")
ylabel("Precision")
grid on
title(sprintf("Average Precision = %.2f",ap))
the graph is shown but it looks bad, something else is wrong also.

댓글을 달려면 로그인하십시오.

답변 (1개)

Dyuman Joshi
Dyuman Joshi 2023년 5월 4일
You need to sort your x data.
recallv = cell2mat(recall);
precisionv = cell2mat(precision);
[r,index] = sort(recallv);
p = precisionv(index);
figure
plot(r,p)
xlabel("Recall")
ylabel("Precision")
grid on
title(sprintf("Average Precision = %.2f",ap))
  댓글 수: 6
Adrian Kleffler
Adrian Kleffler 2023년 5월 4일
recall :
0
[0;0.166666666666667;0.333333333333333;0.500000000000000;0.666666666666667;0.833333333333333]
20x1 double
[0;0.125000000000000;0.250000000000000;0.375000000000000;0.500000000000000;0.625000000000000;0.750000000000000;0.875000000000000;1]
12x1 double
[0;0.111111111111111;0.222222222222222;0.333333333333333;0.444444444444444;0.555555555555556;0.666666666666667;0.777777777777778;0.888888888888889;1]
precision :
1
[1;1;1;1;1;1]
20x1 double
[1;1;1;1;1;1;1;1;1]
12x1 double
[1;1;1;1;1;1;1;1;1;1]
i want to say that i have 6 classes in my project, so in that graph (on the top of the graph, ap = 0,83, ap = 0,29...) i posted, there are average precisions for 6 classes in my opinion ... i don´t know if its possible to combine them to only one average precision or what to do with them... on matlab page there is one example where the graph looks like this (but they had only one class to detect) :
I hope you understand me, and i am so thankful for your answers.
Adrian Kleffler
Adrian Kleffler 2023년 5월 4일
maybe it will be easier to make one graph for each class, but i don´t know how to do it ...

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Networks에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by