rasbt / rasbt/mlxtend

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

Open
#987 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Documentation
Dominant language
Python
Stars
5.2k
Forks
916
Avg merge
17h 31m
Merged PRs (30d)
4

Description

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']

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked mcnemar_table documentation example and its API return description, then compare the checkerboard_plot row and column labels with the returned array. Update the labels or accompanying documentation so the four values match, and verify the rendered example and descriptions agree.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.