文件历史

45 次代码提交

作者 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 f7d6934fff Update tqdm import in filter.py and summary.py (#1012) 2024-02-15 18:26:11 +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
Tata Ganesh d37a7d8d85 Expose low memory option for token and multi-label classification (#822) 2023-08-23 01:14:29 -04:00
Aditya Thyagarajan f8c1866c58 move methods to multilabel_classification module (#657)
adds new dataset summarization methods for multilabel settings

---------

Co-authored-by: Jonas Mueller <1390638+jwmueller@users.noreply.github.com>
Co-authored-by: Elías Snorrason <eliassno@gmail.com>
2023-04-13 21:50:11 -07:00
Jonas Mueller 686cbf63f1 Method to estimate label issues with limited memory via mini-batches (#615)
Co-authored-by: clu0 <33559427+clu0@users.noreply.github.com>
2023-02-10 16:59:16 -08:00
Ulyana d99788b9de Fixed duplicate issue removal in find_label_issues (#624)
Co-authored-by: Jonas Mueller <1390638+jwmueller@users.noreply.github.com>
2023-02-10 08:28:29 -08:00
Jonas Mueller 5f6493f509 fix bug: confidences -> confidence (#623) 2023-02-09 16:33:47 -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
clu0 2b6c56424d 10x speedup in find_label_issues on linux via better multiprocessing (#596)
and bug fixes related to partition vs sort


Co-authored-by: Jonas Mueller <1390638+jwmueller@users.noreply.github.com>
2023-01-19 20:14:03 -05: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
Jonas Mueller 886e6aee6e make mypy v0.990 happy (#530) 2022-11-08 09:56:51 +00:00
Ulyana 7b9c0cf54e Remove strong worded requirement for out-of-sample pred probs (#520)
Co-authored-by: Jonas Mueller <1390638+jwmueller@users.noreply.github.com>
2022-11-07 20:10:07 -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
LunaCodeDemon 7761aefa18 Trying to fix typings (#502)
* Add typing for filter.py

Co-authored-by: Elías Snorrason <eliassno@gmail.com>
2022-10-20 21:53:11 +00: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
Jonas Mueller 7256cd3546 More improvements to token classification code and documentation (#452)
* improved token docs/code

* format paragraphs in docstrings

* fix typo

Co-authored-by: Elías Snorrason <eliassno@gmail.com>
2022-09-16 14:04:45 +00: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
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 dc515c93f3 Update filter.py (#331) 2022-08-03 03:06:07 -07:00
Jonas Mueller 878244f904 Re-order find_label_issues args for better clarity (#329)
* findlabelissues doc clarifications + arg order

* clarify return_indices_ranked_by specifies return

* moved multi_label up higher. kept ranked_by at top

Co-authored-by: Curtis G. Northcutt <curtis.northcutt@gmail.com>
2022-07-29 17:15:46 -04: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
Jonas Mueller 0163751192 Proper validation of labels values/format across package (#301)
* better checks and code

* O(1) pred_probs check, suppress cleanlearning print

* fix verbose docstring default
2022-07-01 23:53:30 -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 d8ab4e910b fix black formatting compliance (#224)
* fix black formatting compliance

* remove codecov for verbose statements
2022-04-17 21:57:15 -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
Anish Athalye 5cf8f74232 Switch to pseudocode math over LaTeX math
In most cases, this looks nicer than the LaTeX math, and it's also more
readable in the terminal.
2022-04-09 08:47:46 -04:00
Anish Athalye 4f717c8d8f Have find_label_issues summarize what it does
Thanks @jwmueller:
https://github.com/cleanlab/cleanlab/pull/189#issuecomment-1093652195.
2022-04-09 07:33:24 -04:00
Anish Athalye 90d6e77ed9 Revise filter 2022-04-09 07:33:24 -04:00
Anish Athalye 49b3717edc Make coarse-grained pass over docs
This patch fixes many of the egregious issues with docs rendering.
2022-04-09 07:33:24 -04:00
Jonas Mueller 423e5b0a07 Polish the APIs and file-structure to prepare for 2.0 release (#181)
* Makes some methods private that are not intended to be user-facing.
* Adds experimental module with fasttext.py and coteaching.py
* Adds header descriptions to code files which will render in docs
* Many miscellaneous fixes
2022-04-06 21:04:06 -07: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
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
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
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