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

Lables of checkerboard plot in example of mcnemar_table do not match the documentation #987

Open
ftnext opened this issue Nov 11, 2022 · 0 comments

Comments

@ftnext
Copy link
Contributor

ftnext commented Nov 11, 2022

Describe the documentation issue

https://rasbt.github.io/mlxtend/user_guide/evaluate/mcnemar_table/#example-2-2x2-contingency-table

The labels of the checkerboard plot do not seem to match the description of the returned value

image

tb is

array([[4, 1],
       [2, 3]])

from returns in https://rasbt.github.io/mlxtend/user_guide/evaluate/mcnemar_table/#api

2x2 contingency table with the following contents: a: tb[0, 0]: # of samples that both models predicted correctly b: tb[0, 1]: # of samples that model 1 got right and model 2 got wrong c: tb[1, 0]: # of samples that model 2 got right and model 1 got wrong d: tb[1, 1]: # of samples that both models predicted incorrectly

  • 4 (tb[0, 0], a) is # of samples that model 1 and 2 got right
  • 1 (tb[0, 1], b) is # of samples that model 1 got right and model 2 got wrong
  • 2 (tb[1, 0], c) is # of samples that model 2 got right and model 1 got wrong
  • 3 (tb[1, 1], d) is # of samples that model 1 and 2 got wrong

Suggest a potential improvement or addition

I think that reversing each labels will work.

brd = checkerboard_plot(tb,
                        figsize=(3, 3),
                        fmt='%d',
                        col_labels=['model 2 right', 'model 2 wrong'],  # As is: ['model 2 wrong', 'model 2 right']
                        row_labels=['model 1 right', 'model 1 wrong'])  # As is: ['model 1 wrong', 'model 1 right']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant