How to make precision and recall of same length?
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello experts. I am working on information retrieval. After searching I have computed the precision (P) and recall (R) for five queries. Every query have different number of TPs so the length of every P and R for five queries is different. How can I make of same internval. For example.
r1 = [0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0];
p1 = [1 1 1 1 1 1 1 1 1 1 ]; % just exmple
r2 = [0.2 0.4 0.6 0.8 1];
p2 = [1.0 0.5 0.5 0.6 0.3];
now can I make both r1 and r2 from 0.1:0.1:1.0 ?
답변 (1개)
Jos (10584)
2018년 9월 28일
You want to do some kind of interpolation, for instance, using:
r12_adjusted = 0.1:0.1:1.0 % take care (##)
p1_adjusted = interp1(r1, p1, r12_adjusted)
p2_adjusted = interp1(r2, p2, r12_adjusted)
However, you could run into problems when you're trying to extrapolate ...
(##) Note, this line might not return what you expect it to return. For instance, this array does not contain 0.3 exactly:
x = 0.1:0.1:1.0
any(x == 0.3) % false!
min(abs(x-0.3)) % very small but not exactly 0!
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Descriptive Statistics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!