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

Add recall_score function in Ivy with Test #27986

Merged
merged 17 commits into from
Feb 25, 2024

Conversation

muzakkirhussain011
Copy link
Contributor

@muzakkirhussain011 muzakkirhussain011 commented Jan 22, 2024

PR Description

This PR introduces the recall_score function in Ivy, supporting binary or multilabel classification. It calculates recall with options for micro, macro, and binary averaging, along with support for sample weights. The code includes clear comments for readability.

A property-based test (test_recall_score) has been added using Hypothesis to ensure the correctness of the recall_score function across diverse input scenarios.

Changes:

Added recall_score function implementation.
Included property-based test (test_recall_score) for comprehensive validation.
Added comments for code clarity

Checklist

  • Did you add a function?
  • Did you add the tests?
  • Did you run your tests and are your tests passing?
  • Did pre-commit not fail on any check?
  • Did you follow the steps we provided?

This commit introduces the recall_score function, which calculates recall for binary or multilabel classification using Ivy's framework. The function supports micro, macro, and binary averaging, as well as the optional use of sample weights. Additionally, the code includes appropriate comments for better readability and understanding.
This commit includes a test for the recall_score function, leveraging the Hypothesis library. The test checks the integration of Ivy's recall_score with the specified backend and frontend configurations, covering various input scenarios. The test logic ensures appropriate handling of data types, values, and optional parameters such as 'average' and 'sample_weight'.
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

PR Compliance Checks

Thank you for your Pull Request! We have run several checks on this pull request in order to make sure it's suitable for merging into this project. The results are listed in the following section.

Issue Reference

In order to be considered for merging, the pull request description must refer to a specific issue number. This is described in our contributing guide and our PR template.
This check is looking for a phrase similar to: "Fixes #XYZ" or "Resolves #XYZ" where XYZ is the issue number that this PR is meant to address.

Protected Branch

In order to be considered for merging, the pull request changes must not be implemented on the "main" branch. This is described in our Contributing Guide. We are closing this pull request and we would suggest that you implement your changes as described in our Contributing Guide and open a new pull request.

Conventional Commit PR Title

In order to be considered for merging, the pull request title must match the specification in conventional commits. You can edit the title in order for this check to pass.
Most often, our PR titles are something like one of these:

  • docs: correct typo in README
  • feat: implement dark mode"
  • fix: correct remove button behavior

Linting Errors

  • Found type "null", must be one of "feat","fix","docs","style","refactor","perf","test","build","ci","chore","revert"
  • No subject found

@muzakkirhussain011
Copy link
Contributor Author

muzakkirhussain011 commented Jan 22, 2024

Hi @zeus2x7 ,
I hope this message finds you well. I've submitted a pull request (PR) for review. Your feedback and insights would be highly appreciated. Please take a moment to review it at your earliest convenience.

Thank you in advance!
Best regards

@muzakkirhussain011
Copy link
Contributor Author

Hi @NiteshK84 ,
I hope you're doing well. I'm writing to remind you about the pull request.

It's been a few days since I sent the pull request and I haven't received any feedback from you. I'm wondering if you have had a chance to review it.

Please let me know if you have any questions or comments about the pull request. I'm happy to make any changes that you suggest.

Thank you for your time and attention.
Best regards

@@ -5,6 +5,49 @@
import numpy as np


@handle_frontend_test(
fn_tree="your.module.path.recall_score", # Update with the correct module path
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @muzakkirhussain011 could you name it correctly with the module path?

@muzakkirhussain011
Copy link
Contributor Author

Hi @zeus2x7 ,
I have updated the module path with the correct one. The new module path is sklearn.metrics.recall_score . Please let me know if this works for you. Thank you.

@muzakkirhussain011
Copy link
Contributor Author

Hi @zeus2x7  ,
I hope you're doing well. I'm writing to remind you about the pull request.

It's been almost a month since I sent the pull request.

I have made the required changes. Please let me know if you have any questions or comments about the pull request. I'm happy to make any changes that you suggest.

Thank you for your time and attention.
Best regards

@zeus2x7
Copy link
Contributor

zeus2x7 commented Feb 16, 2024

Hi @zeus2x7  ,
I hope you're doing well. I'm writing to remind you about the pull request.

It's been almost a month since I sent the pull request.

I have made the required changes. Please let me know if you have any questions or comments about the pull request. I'm happy to make any changes that you suggest.

Thank you for your time and attention.
Best regards

@NiteshK84

@muzakkirhussain011
Copy link
Contributor Author

Hi @NiteshK84  ,
I hope you're doing well. I'm writing to remind you about the pull request.

It's been almost a month since I sent the pull request.

I have made the required changes. Please let me know if you have any questions or comments about the pull request. I'm happy to make any changes that you suggest.

Thank you for your time and attention.
Best regards

@NiteshK84
Copy link
Contributor

Hi @muzakkirhussain011,
Apologies for the delay in response.
Test cases for all the backends are failing
image
@reproduce_failure('6.98.3', b'AXicY2RAAQAAHgAC')
image

@muzakkirhussain011
Copy link
Contributor Author

muzakkirhussain011 commented Feb 23, 2024

Hi @NiteshK84

All backend tests are now passing with the updated code. Please find the attached screenshot for confirmation.
Please review the attached screenshot of the passed backend tests at your earliest convenience.
Thank you
Best Regards
recall_score

@muzakkirhussain011
Copy link
Contributor Author

Hi @zeus2x7  ,

I have completed the backend tests, and all tests are passing successfully. I’ve attached a screenshot of the test results for your reference.

Could you please prioritize the review of this pull request at your earliest convenience? Your timely feedback will be greatly appreciated.

Thank you20240223_201221.jpg

@muzakkirhussain011
Copy link
Contributor Author

Hi @zeus2x7 ,

I've addressed all the requested changes and the backend tests are passing. Could you please review the updates? Thank you!

Best Regards

@NiteshK84
Copy link
Contributor

LGTM!

@NiteshK84 NiteshK84 merged commit 76bef3e into Transpile-AI:main Feb 25, 2024
132 of 141 checks passed
Kacper-W-Kozdon pushed a commit to Kacper-W-Kozdon/ivy that referenced this pull request Feb 27, 2024
Co-authored-by: ivy-branch <ivy.branch@lets-unify.ai>
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

4 participants