文件历史

60 次代码提交

作者 SHA1 备注 提交日期
Ulyana 980c6ddc07 Extend package support Python 10-14 + relax dependencies (#1276) 2026-01-07 14:11:40 -08:00
Jonas Mueller 0167accd0a license (#1263)
change license to Apache 2.0

---------

Co-authored-by: Anish Athalye <me@anishathalye.com>
2025-12-15 16:56:30 -08:00
Elías Snorrason c72f0c2cdf Remove deprecated multi_class argument in LogisticRegression and skip test for sklearn 1.5.0 regression (#1124) 2024-05-24 19:48:04 +00:00
Elías Snorrason 94ab29a46b Enhance test coverage for setting Confident Joint in CleanLearning (#1123) 2024-05-22 16:31:18 +00:00
Tata Ganesh 83731599be Expose low memory option for finding label issues in classification (#791) 2023-08-11 00:35:51 -04:00
Yiran Shi cb4c05cbff Add support for high dimensional arrays in CleanLearning(#749)
Co-authored-by: Jonas Mueller <1390638+jwmueller@users.noreply.github.com>
Co-authored-by: Hui Wen <45724323+huiwengoh@users.noreply.github.com>
2023-06-27 00:12:52 -04:00
Hui Wen 64c6cfcdd5 Pass confident joint computed in CleanLearning to filter.find_label_issues (#661) 2023-04-05 21:21:17 -07:00
Aditya Thyagarajan 7b589f6d63 updating copyright year to include 2023 (#594) 2023-01-06 21:25:57 -08:00
Curtis G. Northcutt c2d319d0ed Add support for missing classes (#511)
Co-authored-by: Jonas Mueller <1390638+jwmueller@users.noreply.github.com>
2022-10-31 16:23:41 -07:00
Mohit Saxena 57adf33369 Adding pylint CI checks (#465)
* Update ci.yml

* remove unused import

* 💚 merge pylint jobs

* 🔧 add .pylintrc

* 🚨 handle pylint errors

Co-authored-by: Elías Snorrason <eliassno@gmail.com>
2022-09-23 16:10:03 +00:00
Elías Snorrason cecaf7aec6 Add y argument as alternative to labels in CleanLearning.fit() (#322)
* 🗑️ change labels arg -> y in CleanLearning.fit()

Set `label` as an optional keyword-only argument.
Anyone still using it in this method should get a deprecation warning.

Fixes #281

* 📝 add note for y/labels in docstring

* 🥅 make y an optional positional arg.

Should now resolve deprecated signatures.

* 📝 labels -> y in module docstring

*  revert "label -> y deprecation"

This reverts commit ab319a0cca2cec715a84eb5f628bbab7706c5f9c.
This reverts commit 1b739002d848e1f0acb6390a666f6e695e25fcaa.
This reverts commit 88bb6c3bcca298dab414c3cb20101783d78d35d1.
This reverts commit d988e3c3932107e779598d02d8f16d7e6671e9e7.

*  add y alias for labels

Resolves #281
2022-07-26 00:59:10 -07:00
Hui Wen f62bc36e54 Allow CleanLearning to use validation data in each fold (#295)
* allow CleanLearning to use val data in each fold

* add unittest for using val data in CleanLearning
2022-06-28 22:04:22 -07:00
Jonas Mueller ffd6fc1b35 Make CleanLearning work with pandas and other non-numpy feature objects X (#285)
* cleanlearning w dfs

* work for sparse matrix as well

* simplify logic of labels_to_array and extend types

* address pr feedback

* add unit test

* rare label dataframe

* modularize subsetting code

* series rarelabel test

* replace cal.com with slack/email

* Add general method to find num_classes from labels

* compute num_classes with pred_probs.shape[1]

* fix broken commits, address 2nd round of comments

Co-authored-by: Curtis G. Northcutt <curtis.northcutt@gmail.com>
2022-06-24 04:01:55 -07:00
Jonas Mueller 74c6d5b98c unittest formatting 2022-05-04 02:52:18 -07:00
Jonas Mueller 7ed44c02ad fix sample_weight unit-test 2022-05-04 02:45:15 -07:00
Jonas Mueller 2c5a0a1f3b test sample_weight 2022-05-04 02:37:23 -07:00
Jonas Mueller d1a4bc86fd Returns DataFrame type from CleanLearning functions (#199)
* df return type, need tests still

* Add pandas as a dependency

We already decided that pandas will be a dependency of cleanlab (also
used in the dataset module, see
https://github.com/cleanlab/cleanlab/pull/182).

* Tweak documentation

* addressed comments

* remove lazy import

* address 2nd round comments

* unit tests

* improve codecov

* Fix typo

* methods to save more space

* nocover statements for prints

* extra nocover

* nocover warnings

* test docstring formatting

* test docstring formatting2

* test docstring formatting2

* move compress to helper, find-label docs params

* readded stuff lost in merge conflict

* addressed remaining PR review comments

* docs formatting

* docs formatting2

* docs formatting3

* docs formatting4

* docs formatting5

* docs formatting5

* docs formatting6

* docs formatting7

* docs formatting8

* docs formatting9

* docs formatting19

* docs formatting20

* docs formatting20

* docs formatting21

* code formatting

* fix a bug where confident joint isnt computed

The confident joint wasn't getting computed if noise_matrix was passed in and pred_probs was not passed in. But that's bad because it stops workflows like:

```python
cl = CleanLearning()
cl.fit(data, labels, noise_matrix=noise_matrix)
cleanlab.dataset.health_summary(labels, confident_joint=cl.confident_joint)
```

* fixed bug from last commit. code in wrong place.

* print overwrite bugfix

Co-authored-by: Anish Athalye <me@anishathalye.com>
Co-authored-by: Curtis G. Northcutt <curtis.northcutt@gmail.com>
2022-04-13 16:00:41 -04:00
Anish Athalye 0be3c70a6e Move noise_generation into benchmarking module 2022-04-08 20:08:19 -04:00
Anish Athalye 947ea9e34a Fix typo in test (#186)
This test had a typo in it ("pred_neq_given" rather than
"predicted_neq_given"), but the way the test was written, it didn't
fail, because GridSearchCV raises a warning if some fits fail. This
patch fixes the typo and adds the assertion that no warnings are raised
during the grid search.
2022-04-07 12:12:50 -07:00
Curtis G. Northcutt c4e84624e9 CleanLearning = Machine Learning with cleaned data (#177)
* CleanLearning = Machine Learning with cleaned data

* Replace lnl instance naming with cl everywhere (CleanLearning)

* replace rp (rank pruning) with cl (clearn learning) everywhere

* Clarifying comments. remove unnecessary newlines. fix spelling err
2022-04-06 17:33:04 -04:00
Jonas Mueller d3eb08e75a added LearningWithNoisyLabels.find_label_issues instance method (#157)
* added LearningWithNoisyLabels.find_label_issues instance method

* LNL.find_label_issues no longer memoizes

* verbose unit test coverage

* Fixed all issues in PR. Fixed confident joint usage in LNL.find_label_issues. Fixed other minor bugs. Added tests

Co-authored-by: Curtis G. Northcutt <curtis.northcutt@gmail.com>
Co-authored-by: Anish Athalye <me@anishathalye.com>
2022-04-06 12:24:27 -04:00
Anish Athalye 5e50623032 Remove unnecessary version warning (#162)
This was used to skip e.g. importing PyTorch on some tests. However,
PyTorch supports all versions of Python that Cleanlab supports, so
there's no need to issue this warning. Furthermore, having this kind of
code in our codebase increases maintenance burden and contributes to
user frustration. If we mark a version of some library as unsupported,
but the library adds support for it in the future, there's no way users
can use the two packages together without waiting for us to push a new
version of cleanlab that marks that it's compatible and then switching
to the new version, which may be painful for unrelated reasons. It's
better to not have these kinds of checks; if users are using a version
of Python that's unsupported by some other library that they want to
use, that's not our problem, and they'll have issues installing or
importing it and figure it out themselves.

This patch also removes mentions of Python 2.
2022-04-05 18:59:58 -04:00
Johnson Kuan 6d8102c7f6 Add fix and test for sklearn GridSearchCV with LearningWithNoisyLabels (#153)
* Move _process_label_issues_kwargs to fit method

* Add test for sklearn GridSearchCV with kwargs

* Add comment to test for sklearn GridSearchCV with kwargs

* Change cv=3 for GridSearchCV in test
2022-03-31 19:21:35 -07:00
Johnson Kuan 0f86e7b884 Enable use of find_label_issues_kwargs for hyper-parameter search (#152)
* Move find_label_issues_kwargs dict arg to init() method

* Update tests after moving find_label_issues_kwargs dict arg to init() method.

* Remove blank line

* Cleanup docstring

* add self.find_label_issues_kwargs
2022-03-31 15:11:03 -07:00
Jonas Mueller 1247f165f2 Improve user-control (#149)
* improved language in docs Quickstart

* LearningWithNoisyLabels refactor to improve API flexibility and UX

* fix LearningWithNoisy rare label handling

* additional arg-checking unit tests
2022-03-30 08:18:38 -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
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 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 49a77ecd8e add agpl-3 license 2021-06-05 21:27:54 -04:00
Curtis G. Northcutt 4575d78a0b do not warn about getargspec. need to support old version 2021-04-08 22:12:19 -04:00
cgnorthcutt bed2fa228c Remove ipynb artificats like # In[0] 2019-08-19 16:59:09 -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 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 daea359f5a Remove deprecated function from testing 2019-07-26 21:37:10 -04:00
cgnorthcutt befbf82090 Remove unused tests. 2019-02-16 04:07:51 -05:00
cgnorthcutt df4369407f Remove references to prune_count_method. 2019-02-16 00:32:18 -05:00
Curtis Northcutt e8001ca024 Added 1e-4 buffer on assertion tests. 2018-12-16 23:16:39 -05:00
Curtis Northcutt c5a7a673b3 Remove ipynb output comments. 2018-12-08 00:07:03 -05:00
Curtis Northcutt 7ec01f3875 Seed all tests. reduce amount of noise in tests. 2018-12-07 16:35:57 -05:00