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

binary/multi-class/multi-label statistics #966

Merged
merged 3 commits into from Oct 20, 2020

Conversation

Scitator
Copy link
Member

Before submitting

  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • Did you read the contribution guide?
  • Did you check the code style? catalyst-make-codestyle && catalyst-check-codestyle (pip install -U catalyst-codestyle).
  • Did you make sure to update the docs? We use Google format for all the methods and classes.
  • Did you check the docs with make check-docs?
  • Did you write any new necessary tests?
  • Did you check that your code passes the unit tests pytest . ?
  • Did you add your new functionality to the docs?
  • Did you update the CHANGELOG?

Description

Related Issue

Type of Change

  • Examples / docs / tutorials / contributors update
  • Bug fix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves an existing feature)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

"""
Computes the number of true negative, false positive,
false negative, true negative and support
for a binary classification problem for a given label.

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
DAR101 Missing parameter(s) in Docstring: - label

"""
Computes the number of true negative, false positive,
false negative, true negative and support
for a multi-class classification problem.

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
DAR101 Missing parameter(s) in Docstring: - argmax_dim

"""
Computes the number of true negative, false positive,
false negative, true negative and support
for a multi-class classification problem.

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
DAR101 Missing parameter(s) in Docstring: - num_classes

support = torch.zeros((num_classes,), device=outputs.device)

for class_index in range(num_classes):
outputs_ = outputs[..., class_index]

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
WPS120 Found regular name with trailing underscore: outputs_


for class_index in range(num_classes):
outputs_ = outputs[..., class_index]
targets_ = targets[..., class_index]

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
WPS120 Found regular name with trailing underscore: targets_

),
],
)
def test_get_binary_statistics(

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
D103 Missing docstring in public function

),
],
)
def test_get_multiclass_statistics(

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
D103 Missing docstring in public function

),
],
)
def test_get_multilabel_statistics(

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
D103 Missing docstring in public function

@Scitator Scitator changed the title bonary, multi-class and multi-label statistics binary/multi-class/multi-label statistics Oct 19, 2020
@Scitator Scitator merged commit a3120ed into master Oct 20, 2020
@mergify mergify bot deleted the feature/classification-statistics branch October 20, 2020 15:14
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

Successfully merging this pull request may close these issues.

None yet

1 participant