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

Error in the roc function? #43

Open
youngjaewoo opened this issue Jun 2, 2018 · 1 comment
Open

Error in the roc function? #43

youngjaewoo opened this issue Jun 2, 2018 · 1 comment

Comments

@youngjaewoo
Copy link

Hi, I don't think roc function is working properly. Here's an example.

gt = [1,2,1,2,1,2,1,2,1,2]
pr = [1,1,1,1,1,1,1,1,1,1]
roc(gt, pr)

This produces

p = 10
n = 0
tp = 5
tn = 0
fp = 0
fn = 0

Above don't look right to me. Or perhaps, I'm using it wrongly in which updated documentation would be useful. The current documentation says,

roc(gt::AbstractArray{T,1} where T<:Integer, pr::AbstractArray{T,1} where T<:Integer) in MLBase at /Users/youngjaewoo/.julia/v0.6/MLBase/src/perfeval.jl:162

@laborg
Copy link

laborg commented Oct 17, 2018

I stumbled over this too. It's not an error, just poor documentation. If you look at the code at

if _ispos(gi) # gt = true
you see its only working for binary input (binary here meaning value 0 or 1 for either ground truth or prediction).

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