Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

feature/mypy-types-cleanlab-internal-utils#608

Open
unna97 wants to merge9 commits intocleanlab:master
base:master
Choose a base branch
Loading
fromunna97:feature/mypy-types-cleanlab-internal-util

Conversation

unna97
Copy link
Contributor

No description provided.

Adding the types for variables within the functions. type cheatsheet:1. np array of float type: npt.NDArray["np.floating[T]"]2. np array of int type: npt.NDArray[np.int_]3. np array of bool type: npt.NDArray[np.bool_]4. np.array of either bool or int: npt.NDArray[Union[np.bool_, np.int_]]
functions added for:1. remove_noise_from_class2. clip_noise_rates3. clip_values4. value_counts
functions added for:1. remove_noise_from_class2. clip_noise_rates3. clip_values4. value_counts
…m:unna97/cleanlab into feature/mypy-types-cleanlab-internal-util
@codecov
Copy link

codecovbot commentedJan 24, 2023
edited
Loading

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.23%. Comparing base(5eb89fc) to head(c2eb833).
Report is 413 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@##           master     #608   +/-   ##=======================================  Coverage   96.23%   96.23%           =======================================  Files          60       60             Lines        4705     4707    +2       Branches      817      817           =======================================+ Hits         4528     4530    +2  Misses         91       91             Partials       86       86

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report?Share it here.

@elisno
Copy link
Member

Thanks for the PR!

The internal utils module is quite large, so how about we work on those in smaller segments (say 5-10 functions/methods)?

I think we can just focus on the functions you've annotated up to this point:

  • remove_noise_from_class
  • clip_noise_rates
  • clip_values
  • value_counts
  • round_preserving_row_totals
  • smart_display_dataframe

@elisno
Copy link
Member

elisno commentedJan 24, 2023
edited
Loading

Inremove_noise_from_class(link):

Note that thenp.copy() function is not typed.

It's outside of our control, so we should ignore the specific warning associated with that function call.

- x = np.copy(noise_matrix)+ x: npt.NDArray["np.floating[T]"] = np.copy(noise_matrix)  # type: ignore[no-untyped-call]

We assume that the copied variable should have the same type as the input (noise_matrix), so we'll help mypy in this line.

@unna97
Copy link
ContributorAuthor

Sure@elisno, do you mean with a separate PR for the above functions?

@elisno
Copy link
Member

You should use this PR for those functions.

@unna97
Copy link
ContributorAuthor

Yes, for bigger files I am using one PR. while for other segments as you have mentioned before.

- value_counts_fill_missing_classes- get_missing_classes- round_preserving_sum- estimate_pu_f1- confusion_matrix- print_square_matrix- print_noise_matrix- print_inverse_noise_matrix- print_joint_matrix- compress_int_array- subset_X_y- subset_labels- num_unique_classes- get_unique_classes- format_labels- smart_display_dataframe
@unna97
Copy link
ContributorAuthor

@elisno sorry for doing so much in a single commit. I did add type hints for functions other than those you mentioned. There are specific errors in outputs that I am unsure about.

@unna97
Copy link
ContributorAuthor

@elisno Did you have a chance to review this?

@unna97unna97 marked this pull request as ready for reviewMarch 20, 2023 10:31
@unna97
Copy link
ContributorAuthor

@elisno I was waiting for suggestions before making any further changes. Will you still be reviewing this branch?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@unna97@elisno

[8]ページ先頭

©2009-2025 Movatter.jp