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

confusmat() errors if class contains 0 #35

Open
asbisen opened this issue Mar 1, 2017 · 1 comment
Open

confusmat() errors if class contains 0 #35

asbisen opened this issue Mar 1, 2017 · 1 comment

Comments

@asbisen
Copy link
Contributor

asbisen commented Mar 1, 2017

if the classes in gt or pred contains 0 the function confusmat errors out with the following error.

gr=[0,1,0,1]
pr=[0,0,1,1]
confusmat(2, gr, pr)

ERROR: BoundsError: attempt to access 2×2 Array{Int64,2} at index [0,0]
 in confusmat(::Int64, ::Array{Int64,1}, ::Array{Int64,1}) at /Users/abisen/.julia/v0.5/MLBase/src/perfeval.jl:17

where as if the classes does not contain 0 everything works

gr=[1,2,1,2]
pr=[1,1,2,2]
confusmat(2, gr, pr)

2×2 Array{Int64,2}:
 1  1
 1  1
asbisen added a commit to asbisen/MLBase.jl that referenced this issue Sep 4, 2018
@asbisen
Copy link
Contributor Author

asbisen commented Sep 4, 2018

Created a pull request #46 that closes this issue.

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

1 participant