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

Fixed #2195, improved ConfusionMatrix docs #2196

Merged
merged 3 commits into from
Sep 15, 2021

Conversation

mfoglio
Copy link
Contributor

@mfoglio mfoglio commented Sep 15, 2021

Fixes #2195

Description: add information about the format of confusion matrix in the docs

Check list:

  • New tests are added (if a new feature is added)
  • New doc strings: description and/or example code are in RST format
  • Documentation is updated (if required)

@github-actions github-actions bot added the module: metrics Metrics module label Sep 15, 2021
Copy link
Collaborator

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @mfoglio
Looks good, I was just thinking about moving this to the end of the docstring as a note.

Btw, we can see rendered docstring here: https://deploy-preview-2196--pytorch-ignite-preview.netlify.app/generated/ignite.metrics.confusion_matrix.confusionmatrix#ignite.metrics.confusion_matrix.ConfusionMatrix

@@ -13,6 +13,10 @@
class ConfusionMatrix(Metric):
"""Calculates confusion matrix for multi-class data.

The confusion matrix is formatted such that columns are predictions and rows are targets.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move this details below after the line L67 and use Note: :

Note:
    The confusion matrix is formatted such that columns are predictions and rows are targets.
    For example, if you were to plot the matrix, you could correctly assign to the horizontal axis
    the label "predicted values" and to the vertical axis the label "actual values".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds great! @vfdev-5 , should I do the edit? If yes, how? :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, let's edit the file locally as suggested. Next, commit and push: git commit -a -m "Updated docstring" && git push origin fix-docs-2195

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Let me know if that's fine.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, IMO looks good now! Thanks for the PR !

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the guidance!

@vfdev-5 vfdev-5 added the docs label Sep 15, 2021
Copy link
Collaborator

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks @mfoglio

@vfdev-5 vfdev-5 enabled auto-merge (squash) September 15, 2021 23:03
@vfdev-5 vfdev-5 merged commit 0eb5946 into pytorch:master Sep 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ConfusionMatrix axis - labels
2 participants