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

Use scikit-learn confusion matrix instead of own custom code #20

Merged
merged 27 commits into from
Nov 10, 2021

Conversation

jo-mueller
Copy link
Contributor

Enhanced overlap matrix calculation with sklearn implementation

The calculation of the label overlap matrix has been exchanged with the implementation from sklearn, which is considerably faster. After the upgrade, the benchmark (/notebooks/label/overlap_matrix_benchmarking.ipynb)) shows comparable results for both approaches.

Type of change

  • Bug-fix
  • New feature
  • Breaking change
  • Documentation update

References

Closes #3

Tests

  • I adapted existing tests, because
  • I added new tests to cover the code change
  • All tests pass with my change

Final checks

  • My change is the minimal possible work for the desired feature/fix
  • I updated the documentation where necessary to cover the change

Copy link
Member

@haesleinhuepf haesleinhuepf left a comment

Choose a reason for hiding this comment

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

Hi Johannes @jo-mueller ,

just some minor stuff and I'm suggesting to remove one function. Furthermore, could you please also delete overlap_matrix_benchmarking.ipynb? I created this branch with that notebook just to demonstrate something. I wasn't thinking of making this notebook part of the repository.

I'm happy to merge your changes afterwards.

Thanks!

Best,
Robert

biapol_utilities/label/_label_overlap_matrix.py Outdated Show resolved Hide resolved
biapol_utilities/label/_label_overlap_matrix.py Outdated Show resolved Hide resolved
biapol_utilities/label/_match_labels.py Show resolved Hide resolved
biapol_utilities/label/_match_labels.py Outdated Show resolved Hide resolved
tests/test_intersection_over_union.py Outdated Show resolved Hide resolved
jo-mueller and others added 5 commits November 9, 2021 11:02
Co-authored-by: Robert Haase <haesleinhuepf@users.noreply.github.com>
Co-authored-by: Robert Haase <haesleinhuepf@users.noreply.github.com>
The functionality is now directly implemented in the _intersection_over_union.py
@jo-mueller
Copy link
Contributor Author

Synopsis:

  • Removed label_overlap_matrix (ad0e7f8)
  • generalized IoU test (cd894ae)
  • removed benchmark notebook (56e718f)

@haesleinhuepf
Copy link
Member

Hi Johannes @jo-mueller ,

this all looks good to me. Shall I merge?

@haesleinhuepf haesleinhuepf changed the title Compare overlap matrices Use scikit-learn confusion matrix instead of own custom code Nov 10, 2021
@jo-mueller
Copy link
Contributor Author

Yes :)

@haesleinhuepf haesleinhuepf merged commit c43da27 into main Nov 10, 2021
@haesleinhuepf haesleinhuepf deleted the compare_overlap_matrices branch November 10, 2021 19:03
@haesleinhuepf
Copy link
Member

Wonderful. Thanks for working on this @jo-mueller !

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.

Check if scikit-learn has functions that we can reuse
2 participants