How to make precision and recall of same length?

조회 수: 1 (최근 30일)
Aravin
Aravin 2018년 9월 28일
답변: Jos (10584) 2018년 9월 28일
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
madhan ravi
madhan ravi 2018년 9월 28일
what is your input and your desired output?

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

답변 (1개)

Jos (10584)
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!

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by