Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interpretation Sensitivity and normalized rank of a perfect model #10

Open
c1au6i0 opened this issue Mar 16, 2019 · 3 comments
Open

Interpretation Sensitivity and normalized rank of a perfect model #10

c1au6i0 opened this issue Mar 16, 2019 · 3 comments
Assignees

Comments

@c1au6i0
Copy link

c1au6i0 commented Mar 16, 2019

I have some problem interpreting the following graphs that plot Sensitivity vs Normalized Rank of a perfect model.

library(precrec)
p <- rbinom(100, 1, 0.5) # same vector for predictions and observations
prc <- evalmod(scores = p, labels = p, mode="basic")

autoplot(prc, c("Specificity", "Sensitivity"))

000009

I would expect that a perfect model would generate values of Specificity = Sensitivity = 1 for all the retrieved ranked documents and thus, a line with slope 0 and intercept 1. I am clearly missing something and/or misinterpreting the x axis label. Any hint?

Thanks

@takayasaito takayasaito self-assigned this Mar 18, 2019
@takayasaito
Copy link
Member

Yes, both specificity and sensitivity should be 1 for all the ranks as you mentioned. It seems like the calculation of normalised ranks is incorrect in this case.

@takayasaito
Copy link
Member

The current version of precrec does not provide a clear and intuitive calculation method for ties when mode="basic" is specified. For example, rbinom(100, 1, 0.5) produces many tied scores that are either 0 or 1. The following 3 plots were created by precrec for a dataset generated by rbinom(100, 1, 0.5).

image1

The red dots in the specificity and the sensitivity plots correspond to the red line in the ROC plot. Also, the red dots indicate that specificity stays at 1 while sensitivity changes from 0 to 1. This approach is not incorrect, and it is handy to calculate interpolated ROC and precision-recall curves. Nonetheless, the following plots can be more intuitive when there are tied scores and mode="basic" is used.

image2

The plots above were generated in a way that the same ties have the same sensitivity and specificity. I need to look into whether or not this approach makes sense and how to implement it if so.

@c1au6i0
Copy link
Author

c1au6i0 commented Mar 27, 2019

Thank you for the reply. I think that I understand what you mean and now I get it. The ROC curve really helped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants