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

Calculate auc in pROc #32

Closed
anka0501 opened this issue May 25, 2018 · 4 comments
Closed

Calculate auc in pROc #32

anka0501 opened this issue May 25, 2018 · 4 comments

Comments

@anka0501
Copy link

I'm trying to calculate auc based on a pROC package. I use the formula:

auc(set_temp$def_woe,set_temp$total_pymnt_woe)

Unfortunately, for some variables, I getting an error:
Error in if (thresholds[tie.idx] == unique.candidates[tie.idx -1]) { : argument is of length zero

@xrobin
Copy link
Owner

xrobin commented May 25, 2018

Do you have infinite values in the predictor variable? any(is.infinitie(set_temp$total_pymnt_woe)).
If so we're looking at issue #30. Otherwise, can you please identify which variable is causing this error and isolate a reproducible example?

@anka0501
Copy link
Author

Thanks for the answer. My predictor variable has infinite values. So probably that's why the error appeared. I realized that this code worked on the older version of R. I reinstalled R from the version 3.5 to 3.4 and it works.

@xrobin
Copy link
Owner

xrobin commented May 26, 2018

This has nothing to do with the version of R, only that of pROC. The current error message is meaningless and I apologize about it. But versions prior to 1.12 could produce invalid ROC curves instead (ie. not reaching 0 or 100% sensitivity or specificity). V. 1.12 still does in some cases.

Version 1.13 in preparation will reject infinite values as described in issue #30, with a meaningful error message. This is because infinities cannot be thresholded properly from -Inf to +Inf as is required for ROC analysis. If you have infinite values in your predictor I suggest you find a way to replace them by finite values.

@xrobin xrobin closed this as completed May 26, 2018
@anka0501
Copy link
Author

You're right. I will change it. Thanks for the help.

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