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

_generate_matrix implicitly assumes zero encodes nodata #13

Open
robmarkcole opened this issue Jan 26, 2024 · 1 comment
Open

_generate_matrix implicitly assumes zero encodes nodata #13

robmarkcole opened this issue Jan 26, 2024 · 1 comment

Comments

@robmarkcole
Copy link

robmarkcole commented Jan 26, 2024

I've had some headaches evaluating on another dataset since the implementation here in _generate_matrix assumes nodata is encoded as zero - however in my dataset 0 was a class and 255 was nodata.

Suggest either clarifying this expectation of the encoding, or allowing passing of a nodata value similar to here and here

@samKhallaghi
Copy link
Member

Hi Robin,
_generate_matrix is not causing the problem. Two other places in the acuracy_metric module are causing the issue for your usecase. One is plot_confusion_matrix function which explicitly removes class 0 as the nodata class (but this is just visualization). The main source of the problem for you is line 240 in the module: for i in range(1, evaluator.num_class): which needs to get changed to for i in range(evaluator.num_class): to include class 0 as a valid class and produces metric for it in the csv file.
I will revise the module to be able to handle more general cases as you suggested.

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