文件历史

63 次代码提交

作者 SHA1 备注 提交日期
Ulyana 04d9ad51d1 Remove Tensorflow from docs + code (#1289) 2026-01-08 20:25:06 -08:00
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
Curtis G. Northcutt e4be990d65 Add clarifying comment 2024-07-08 23:08:56 -07:00
Curtis G. Northcutt 00ae7c83b2 Fix comment formatting 2024-07-08 23:02:46 -07: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
Martin Zornoza Auñon 7d1f335017 Improve performance of find_label_issues for segmentation (#1067) 2024-04-10 21:09:28 +00:00
Aditya Thyagarajan ae085b45b5 ensure near-predicted labels are not flagged as label issue (#950)
* ensure near-predicted labels are not flagged as label issue
2024-01-10 11:39:28 +05:30
Gibson Han e90dea60c7 702 - Shorten Refs of classes and functions (#831)
Co-authored-by: Elías Snorrason <eliassno@gmail.com>
Co-authored-by: tataganesh <tataganesh95@gmail.com>
2023-12-07 13:37:16 +00:00
Tata Ganesh 6d45971cf8 List comprehension to numpy ops for efficiency (#844)
Co-authored-by: Elías Snorrason <eliassno@gmail.com>
2023-09-20 19:19:51 +00: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
Gordon Lim 860bd6f551 Dont print recompute joint warning when estimation_method = off_calibrated_custom (#746) 2023-06-18 17:02:51 -07:00
Hui Wen 00776646a7 Fix bug with call to find_overlapping_issues without specifying labels (#652)
* fix None labels issue

* build:  add hypothesis to dev dependencies. Used for property-based testing

* test:  test that find_overlapping_classes can run by only providing a confident joint

Resolves #651

---------

Co-authored-by: Elías Snorrason <eliassno@gmail.com>
2023-03-13 15:37:00 +00:00
Ulyana 70a2ed2fa2 Add clipping of small probabilities to address issue #639 (#647)
Co-authored-by: Jonas Mueller <1390638+jwmueller@users.noreply.github.com>
2023-03-12 20:51:03 -07:00
Hui Wen dbc87116ea Documentation improvements (#643) 2023-02-28 16:06:17 -08:00
Curtis G. Northcutt 0c02ec953b Add two methods to filter.find_label_issues (#595)
"low_self_confidence" or "low_ normalized_margin"

Co-authored-by: huiwengoh <45724323+huiwengoh@users.noreply.github.com>
Co-authored-by: Jonas Mueller <1390638+jwmueller@users.noreply.github.com>
2023-01-31 23:26:20 -08:00
Ulyana 888246e2d5 Improve num_label_issues usage of confident_joint to match find_label_issues (#610)
Co-authored-by: Jonas Mueller <1390638+jwmueller@users.noreply.github.com>
2023-01-27 14:47:02 -08:00
Aditya Thyagarajan 7b589f6d63 updating copyright year to include 2023 (#594) 2023-01-06 21:25:57 -08:00
Jonas Mueller a222859569 Improve docs in label error detection methods for classification data + filter/count mypy type annotations (#543) 2022-11-23 23:01:36 -08:00
Aditya Thyagarajan f37ba9ff39 support missing classes in multilabel tasks (#523) 2022-11-04 15:00:43 -07:00
Aditya Thyagarajan cbe3ce0f20 move multilabel functions to utils (#515)
Co-authored-by: Jonas Mueller <1390638+jwmueller@users.noreply.github.com>
2022-11-03 10:16:28 -07: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
Aditya Thyagarajan b12d76b6d1 Multilabel code restructuring with aggregation/scorer functions (#509)
_find_label_issues_multilabel uses EMA instead of mean-pooling when computing label quality scores

Co-authored-by: Elías Snorrason <eliassno@gmail.com>
Co-authored-by: Jonas Mueller <1390638+jwmueller@users.noreply.github.com>
2022-10-28 16:26:39 -07:00
Aditya Thyagarajan e060f551fb supporting multilabel via one-vs-rest reductions (#483)
Co-authored-by: Elías Snorrason <eliassno@gmail.com>
Co-authored-by: Jonas Mueller <1390638+jwmueller@users.noreply.github.com>
2022-10-17 12:09:23 -07:00
Ulyana 57bcfd0a99 Mypy typechecking fix for num_label_errors (#500) 2022-10-07 19:43:40 -07:00
Ulyana 2906bf6292 Update # issues returned by num_label_issues (#485)
* Added code and test for returning correct num label issues

* Fixed docstring

* Addressed mypy uncertain typing issue

* Added typing and typing checks

* Addressed PR comments
2022-10-05 20:55:49 -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
Curtis G. Northcutt 1b813d9666 fix bug in hard-coded test. generalize the test (#448)
* fix bug in hard-coded test. generalize the test

* 🐛 cast rounded num_issues to int

np.rint outputs an array of the same shape and type as its input. num_label_issues is expected to return an integer.

Co-authored-by: Elías Snorrason <eliassno@gmail.com>
2022-09-15 18:16:56 -04:00
Curtis G. Northcutt 3ff8fab2d9 make num_label_issues = cj calibrated offdiag sum (#445)
The discrepancy occurs because cj calibrated maintains a guarantee that it will perfectly count every example in the dataset (assumes no out of distribution examples).

You can see this when by following this change of methods:

* see `calibrate_confident_joint`, specifically this line here: https://github.com/cleanlab/cleanlab/blob/master/cleanlab/count.py#L172
* round here https://github.com/cleanlab/cleanlab/blob/9240a8c56d020abec8566a0a56d22dcb99d32528/cleanlab/internal/util.py#L209
* the actual rounding occurs here https://github.com/cleanlab/cleanlab/blob/9240a8c56d020abec8566a0a56d22dcb99d32528/cleanlab/internal/util.py#L174

the fix to make `num_label_issues` the same is just to round instead of flooring.

see the two GREEN columns in the attached image

> [nit] consider `np.rint()` instead of `np.round()` for clarity

good call. updated
2022-09-15 11:44:27 -07:00
Jonas Mueller a4ad6460a2 Format return docstrings and add typing (#437)
* typing and return docstrings

* address typing complaints

* allow redefinition

* typing complains for pandas

* .values -> to_numpy()
2022-09-15 11:46:14 +00:00
Curtis G. Northcutt 3fb4133a5c np.array to np.ndarray 2022-08-09 03:30:57 -04:00
Curtis G. Northcutt 72d6c73a94 Clarify shapes of matrices in cj_multi_label 2022-08-09 03:25:03 -04:00
Ulyana c0fe76c098 Changed all docstring instances of np.array to np.ndarray (#336)
* Changed all instances of np.array in docstring to np.ndarray

* np.array is NOT a proper class name it is just a function to
  create np.ndarrays and therefore should not be parameter class

* Black formatting compliance
2022-08-08 23:30:12 -07:00
Jonas Mueller b93fdebf30 Add compatibility for tensorflow and pytorch Dataset objects (#311)
* validation_func docstring

* torch,tf compatibility+tests

* keras test

* skip tests if python < 3.7

* pytorch numpy int bug on windows

* make tensorflow test work on windows

* move tf env variable setting

* pytorch test increase epochs

* install cpu-tensorflow on windows CI

* torch test optimizer to adam

* fix bugs in shuffled TF dataset

* dummy unit test for TF on windows

* dummy code for TF windows testing

* deal with np.int bug on windows

* remove windows debugging code

* docstrings for new functionality

* address merge conflicts

* reformat after merge

* addressed comments
2022-07-27 21:42:13 -07:00
Hui Wen 6c6c13664e Standardize naming on K, num_classes and N, num_examples (#312)
* update N in classification.py

* minor docstring changes on K-1 classes

* use K in shape

* minor grammar fixes

* docs language improvements

Co-authored-by: Jonas Mueller <1390638+jwmueller@users.noreply.github.com>
2022-07-18 18:50:17 -07:00
Jonas Mueller 9c543c6cba error for missing classes, consistency on determining num_classes, code cleanup (#308)
* edge cases

* unique_classes in get_confident_thresholds
2022-07-12 14:45:20 -07:00
Anish Athalye 0705ff2d0a Add static type checking
Our package doesn't have type annotations everywhere, so we can't use
mypy in strict mode just yet. Still, adding type checking in CI is
valuable, so we don't have unchecked annotations in our code.

This patch includes basic fixes to make type checking pass, including
switching the incorrect `np.array` type annotation for `np.ndarray` and
adding some assertions for flow-sensitive typing.
2022-07-06 17:21:56 -04: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
Curtis G. Northcutt af11106e77 Clarify labels format (#282)
Add clarification of the labels format requirements for all major API functions.

* Fix broken link

* Clarify reqs for labels format. rank.py does not yet support multi_label

* add double ticks to code in docstrings

* clarify docstring

* further clarify multi_label vs single label labels reqs

* also add new docstring to confident joint
2022-06-20 12:58:24 -07:00
Curtis G. Northcutt eb54447901 Change shape (N, ) back to (N,) to adhere to numpy standard 2022-06-20 11:10:00 -07:00
Curtis G. Northcutt 25036dc48e clarify expectation for labels 2022-06-20 10:32:28 -07:00
Curtis G. Northcutt 5bbea05992 Replace shape (N,) with (N, ) everywhere 2022-06-20 10:30:12 -07:00
Curtis G. Northcutt 1f40bdcd67 clarify all labels must be present in docstring 2022-06-19 16:00:51 -07:00
Curtis G. Northcutt 670d9d680e use shape[1] instead of unique everywhere. replace K with num_classes 2022-06-19 15:56:13 -07:00
Curtis G. Northcutt fc0db77892 remove unused code and unused param in docstring 2022-06-19 15:46:52 -07:00
Curtis G. Northcutt 215945f690 Remove redundant code. replace unique with pred_prob shape 1 2022-06-19 15:45:29 -07:00
Curtis G. Northcutt 7aa34a33ba Fix bug. get thresholds broken for multi_label 2022-05-20 21:55:32 -04:00
Curtis G. Northcutt e971350795 Clarify and fix several docstrings. (#214)
* Clarify and fix several docstrings.

* Adjustments based on Jonas's comments.

* fix typo
2022-04-15 19:06:45 -04:00
Curtis G. Northcutt 269a09d1b3 Fix error in docstring. missing item in tuple 2022-04-13 21:17:22 -07:00