文件历史

提交图

272 次代码提交

作者 SHA1 备注 提交日期
Jonas Mueller 00e3681955 Merge pull request #148 from anishathalye/allow-nd
Allow n-dim data in LearningWithNoisyLabels
2022-03-28 21:24:36 -07:00
Anish Athalye aec6734902 Allow n-dim data in LearningWithNoisyLabels
LearningWithNoisyLabels used `sklearn.utils.check_X_y` to enforce that
`X` was 2D, to be in line with what sklearn's standard estimators
expect. However, LearningWithNoisyLabels is dataset-agnostic: it doesn't
look at the data points themselves. If the underlying classifier
supports data in a different shape, there's no reason
LearningWithNoisyLabels should prohibit it. Users have requested that we
relax this unnecessary restriction [1] so LearningWithNoisyLabels will
more naturally support e.g. image datasets and CNN models.

Thanks to @kothari1997narayan for suggesting this change.

[1]: https://github.com/cleanlab/cleanlab/issues/86
2022-03-29 00:16:40 -04:00
Anish Athalye 51a4c921b1 Remove unnecessary print statement (#145)
This was accidentally included in
0a6b55b323.
2022-03-28 15:40:11 -07:00
Jonas Mueller dac3d12717 merge np.long->int32 update 2022-03-28 13:17:10 -04:00
Jonas Mueller 7b2340b638 Utilites -> internal submodule refactor (#141)
* utilities -> internals

* docbuilding instructions improvement

* fixup formatting of contributing.md

* change contributor guidelines language to be optional

* line formatting
2022-03-28 09:53:10 -07:00
Anish Athalye 0a6b55b323 Fix NumPy deprecation warning
`np.long` was deprecated in NumPy 1.20, and this was making the test
output noisy with deprecation warnings. This patch replaces the type
with `np.int32` (the labels are 0--9).
2022-03-28 09:45:06 -04:00
Johnson Kuan c50836cfbf Add label quality scoring functions and user API to choose the method (#131)
* Add label quality scoring function for users to choose the scoring method.

Add confidence_weighted_entropy as another label quality score that is available for scoring and ranking.

Add option in scoring function to adjust predicted probabilities by subtracting the class thresholds.

Refactor order_label_issues to use the new label quality scoring function and accept keyword args.

* Cleanup docstring in label quality scoring functions

* Change rank_by_kwargs default to empty dict. Dict is used as keyword args for label quality scoring function.

* Cleanup docstrings. Add **rank_by_kwargs to signature of order_label_issues function.

* Add exception handler for invalid rank_by methods

* Add **rank_by_kwargs to allow keyword args in find_label_issues()

* Add test for confidence_weighted_entropy rank scoring function

* Add test for scoring function that accepts scoring method

* Cleanup comments

* Update test for scoring functions

* Update test for scoring functions

* Modify order_label_issues() function to run score_label_quality with (labels, pred_probs) and then filter with label_issues_mask. This is more robust to allow us to adjust the pred_probs (e.g. subtract confident class thresholds)

* Update test for label quality scoring

* Update test for label quality scoring

* Update exception handler for label scoring function

* Add test for subtracting confident class thresholds

* Update test for subtracting confident class thresholds

* Update test for subtracting confident class thresholds

* Add ensemble label quality scoring function

* Update test for ensemble label quality scoring function

* Update test for ensemble label quality scoring function

* Update docstrings for functions that accept adj_pred_probs with description of the adjustment to pred_probs

* Update find_label_issues to pass rank_by_kwargs as a dict

* Cleanup comments

* Refactor tests for scoring functions to avoid redundancies

* Refactor tests for scoring functions to avoid redundancies. Use parameterize instead of for-loop

* Parameterize scoring method to test ensemble scoring function

* Print scoring method when scoring function test fails

* Cleanup docstrings to avoid redundancies

* Move class confident threshold functions to new label quality utils module. Add weight_ensemble_members_by parameter to label quality ensemble scoring function allows users to choose weighting scheme (uniform, accuracy). Enhance tests for CI.

* Add test for CI. Test bad arg for weight_ensemble_members_by parameter.

* Add explicit error checking of pred_probs_list arg.

* Cleanup docstring and print statements

* Cleanup docstrings. Move get_entropy to utils. Refactor score_label_quality_ensemble to print accuracy weights

* Change default label quality scoring method to normalized_margin. Add to docstring explaining when to use normalized_margin vs self_confidence.

* Cleanup docstring

* Cleanup docstrings. Rename get_entropy() to get_normalized_entropy()

* Rename score_label_quality() to get_label_quality_scores(). Rename score_label_quality_ensemble() to get_label_quality_ensemble_scores().

* Remove extra indent in docstring

* Rename adj_pred_probs to adjust_pred_probs. Move get_confident_thresholds() to count.py module.

* Add comment to explain why we add a dimension for numpy broadcasting.

* Change renormalization logic when adjusting pred_probs. Raise ValueError when adjust_pred_probs is used with unsupported scoring method. Add test for ValueError.

* Update tests to account for unsupported method when running adjust_pred_probs.

* Enhance docstring tests
2022-03-26 18:50:34 -07:00
Anish Athalye 11dff1faf4 Standardize code style to Black (#107)
* Set up Black as the code style

* Migrate code style to Black
2022-03-16 21:27:36 -04:00
Curtis G. Northcutt 8f9f3f5380 Major API change. Introducing Cleanlab 2.0 (#128)
* Refactor modules pruning to filter and latent_estimation to count

* Remove polyplex (research) algorithms from cleanlab

* Create new module rank and move scoring functions to rank.

* Rename test to match new module names

* Fixed error in normalized margin. added ranking for arbitrary psx and labels.

* Remove unused tests and methods. add multi-label support for baseline.

* Move baseline methods to filter and delete baseline module.

* change filter.get_noise_indices to filter.find_label_issues

* Rename baseline methods. fill out docstrings.

* Only require 1 example to be left in each class after removing errors. (instead of 5)

* Remove K as a parameter to count.compute_confident_joint

* Add C_argmax and C_ij methods from CL paper to find_label_issues

* Add warnings for new prune methods and frac_noise. Fix tests.

* Add baseline tests to test_rank_filter and delete baseline test

* Remove inverse_noise_matrix parameter in classification call to find_label_issues

* add todo to update docstring with new ranking functions

* 100% tests pass. add multi-label support for prune_method

* Major NOT-backwards-compatible name changes to most components

* More Major NOT-backwards-compatible name changes

* fixed s -> label mistakes

* Several nomenclature updates from PR feedback. models renamed to example models.

* Remove python2 support across all modules.

* major api changes. psx -> pred_probs. prob_given_label -> self_confidence. testing added.

* enable python version 3.9 for pytorch model.

* ran spellcheck

* ran grammar check

* Update count.py

* Update filter.py

* Update setup.py and ci.yml to no longer support Python 2 and py3.4/5

* Increase test coverage and documentation of rank module methods.

* create utils submodule and move util and latent_algebra

* Rename y everywhere to true_labels, and p(true_label=..)

* Enforce positional arguments in methods. Fully remove py2 support.
2022-03-16 06:52:03 -04:00
Anish Athalye 1e16d7fd76 Merge branch 'anishathalye/copyright-assign' 2022-01-10 06:06:51 -05:00
Anish Athalye 13895791ef Bump copyright year 2021-12-31 11:02:23 -05:00
Anish Athalye 0fc2ddc974 Switch copyright assignment to Cleanlab 2021-12-27 09:59:29 -05:00
Anish Athalye 7e7cdb456f Sync license text
This patch updates metadata in `setup.py` and comments in other files to
clarify that the current license is AGPLv3, as is specified in the
current `LICENSE` file.

This patch also removes the "this agreement applies to this version and
all previous versions" text from the README and code comments, because
it is redundant; the previous code was already released under a _more
liberal_ license, so giving the option of AGPLv3 is not useful (and
perhaps confusing).
2021-12-27 09:43:56 -05:00
Curtis G. Northcutt 9575c08f05 add agpl-3 license 2021-06-05 21:28:39 -04:00
Curtis G. Northcutt 7619701ff9 add agpl-3 license 2021-06-05 21:28:12 -04:00
Curtis G. Northcutt 49a77ecd8e add agpl-3 license 2021-06-05 21:27:54 -04:00
Curtis G. Northcutt 0420eaa4a4 Update targets to type long for pytorch compatibility on windows. 2021-04-08 22:44:27 -04:00
Curtis G. Northcutt e81cabef1e yann lecunn blocked auto-download of mnist. use sklearn digits instead 2021-04-08 22:13:04 -04:00
Curtis G. Northcutt 4575d78a0b do not warn about getargspec. need to support old version 2021-04-08 22:12:19 -04:00
Curtis G. Northcutt 7dc1b14aa5 add support for python version 3.8 2021-04-08 22:11:49 -04:00
Curtis G. Northcutt fab4ff300a typo correction 2021-03-03 18:14:58 -05:00
Curtis G. Northcutt d4204f35b5 Add GPU GPL licensing 2021-03-03 18:14:36 -05:00
Curtis G. Northcutt 5ece3b735d Create README.md 2021-03-03 18:13:38 -05:00
Curtis Northcutt b45ebd1688 No longer support python2 and pytorch compatibility 2020-02-25 22:09:45 -05:00
cgnorthcutt 6791134f70 fix docstrings to double quote 2020-02-17 01:57:53 -05:00
cgnorthcutt 2479c636a5 pep-8 adherence 2020-02-16 20:51:26 -05:00
cgnorthcutt 994625beb2 add testing for parameters 2019-09-19 12:26:10 -04:00
Curtis Northcutt 658525dcb2 move data creation to global 2019-09-04 17:01:43 -04:00
Curtis Northcutt 4c0903be7b move data creation to global 2019-09-04 16:59:57 -04:00
Curtis Northcutt e8411c273c testing for baseline methods 2019-09-04 16:53:48 -04:00
Curtis Northcutt cfde73314a fixed issue where param wasn't getting used 2019-09-04 00:07:35 -04:00
Curtis Northcutt 8de04b0f42 Add testing for n_jobs param in pruning 2019-09-03 23:29:16 -04:00
cgnorthcutt 579460f8ab Added testing for confusion_matrix 2019-08-19 18:03:07 -04:00
cgnorthcutt fc55579eb6 Merge branch 'master' of github.com:cgnorthcutt/cleanlab 2019-08-19 16:59:13 -04:00
cgnorthcutt bed2fa228c Remove ipynb artificats like # In[0] 2019-08-19 16:59:09 -04:00
Curtis G. Northcutt ecd7a191c0 No longer support fasttext as a direct dependency. 2019-08-19 16:56:22 -04:00
Curtis G. Northcutt f076c51569 Fix test_small_data. Now it uses a small dataset. 2019-08-19 15:32:59 -04:00
Curtis G. Northcutt 33db501ad6 Fixed test failure due to rounding issue. 2019-08-19 15:25:35 -04:00
Curtis G. Northcutt 41e9ea5ce2 syntax error. define global before using. 2019-08-19 15:12:52 -04:00
Curtis G. Northcutt 42343dbf67 bug fix: syntax typo 2019-08-19 15:04:19 -04:00
Curtis G. Northcutt f0cd37b0ed Fixed use of seed as global variable 2019-08-19 14:53:35 -04:00
Curtis G. Northcutt 03d436b52f fixed issue with local variable hiding global 2019-08-19 13:50:47 -04:00
Curtis G. Northcutt 26075c3a0c Reduce size of make_data and only create data once 2019-08-19 13:49:27 -04:00
Curtis G. Northcutt d4e51b60d6 Merge branch 'master' into add-sparse-support 2019-08-19 10:31:43 -07:00
gilad-rubin 9b50b62e44 removed "make data" outside the functions 2019-08-17 18:53:45 +03:00
gilad-rubin 02b8398abd added sparse support 2019-08-03 18:13:28 +03:00
Curtis Northcutt 988cdf3cd5 Added test for pruning sorted_index_method 2019-07-27 18:52:34 -07:00
Curtis Northcutt 976bde7a1c BIG CHANGE: added multi_label support, fixed cj rounding, added tests 2019-07-27 18:23:11 -07:00
Curtis Northcutt 1b04c7c346 remove calls to estimate_confident_joint_from_probabilities 2019-07-26 22:23:36 -04:00
Curtis Northcutt 2d72157a44 moved joint assertions to tests. 2019-07-26 22:03:04 -04:00