文件历史

21 次代码提交

作者 SHA1 备注 提交日期
Ulyana 04d9ad51d1 Remove Tensorflow from docs + code (#1289) 2026-01-08 20:25:06 -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
Ganesh Tata 51de77768d Multilabel Issue Manager for Classification (#929)
* Add Multilabel label issue manager

* Add task validation in Datalab constructor

* Add type checks for labels in issue managers

* Refactor code to use Datalab for finding label issues in multi-label classification tutorial

---------

Co-authored-by: Elías Snorrason <eliassno@gmail.com>
2024-01-24 00:14:04 +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
Aditya Thyagarajan 7b589f6d63 updating copyright year to include 2023 (#594) 2023-01-06 21:25:57 -08:00
Aditya Thyagarajan f37ba9ff39 support missing classes in multilabel tasks (#523) 2022-11-04 15:00:43 -07:00
Hui Wen 1085faca4a support missing classes in multiannotator functions (#519) 2022-11-03 23:25:03 -07:00
Jonas Mueller 2bff4d5dd6 Better missing class support for label quality scoring (#518) 2022-11-02 18:14:16 -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
Hui Wen f8a831d239 Add internal function to properly format labels (#504) 2022-10-24 10:54:59 -07:00
Hui Wen 06ed233a25 Error handling for rare classes (#455)
* error handling for rare classes

* change subtract to symmetric difference

* remove extra np.unique

* add warning for all instances of getting consensus labels

* error checking edits

* Add typing

Co-authored-by: Elías Snorrason <eliassno@gmail.com>

* black formatting

* update typing - labels_multiannotator will always already be converted to pd.dataframe

* make pred_probs options in typing

* add =None

* docstring edits

Co-authored-by: Jonas Mueller <1390638+jwmueller@users.noreply.github.com>

* add basic docstring

* Changed to verbose

* Removed unessesary calculation out of get_labels_quality_m

* Update cleanlab/multiannotator.py

* comment for lost classes check so it can be grepped

* caution about setting verbose to false

* advise against verbose=false in docstring

Co-authored-by: Elías Snorrason <eliassno@gmail.com>
Co-authored-by: Jonas Mueller <1390638+jwmueller@users.noreply.github.com>
Co-authored-by: Ulyana <ulyana@cleanlab.ai>
2022-09-16 19:26:29 -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
Jonas Mueller 31d4370701 Add missing docs pages (#381)
* add files to show docs for recent source code

* temp delete audio tutorial for docs on M1

* black formatting
2022-08-31 02:28:45 -07: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
Hui Wen e9db4bc30a allow missing classes in assert_valid_class_labels (#335) 2022-08-08 21:59:14 -04:00
Hui Wen b96a78405e allow missing classes in get_label_quality_scores (#334) 2022-08-08 13:23:01 -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
Elías Snorrason 8b60a381e4 validation.py: Annotate function args and return values (#317)
* 🏷️ annotate function args and return values

Starting with the validation module:

- I think (X, y) might need some custom Union type to handle both numpy arrays and pandas dataframe, etc.
- All of the "assert" functions return None.

Ref #307

* refactor: 🏷️ swap npt.NDArray -> np.ndarray

np.ndarray seems more consistent with the rest of the repo.
Maybe it's necessary to go back to npt.NDArray when disallowing generics?

See numpy docs: https://numpy.org/devdocs/reference/typing.html#numpy.typing.NDArray

* refactor: 🔥 remove unused import

* 🏷️ unconstrain X input types

* 🐛 handle label type issues

- Have to restrict the output of labels_to_array to pass mypy checks.
- Returning the values of pd.Series isn't type-stable.

* 🏷️ include np.generic in arg-type union

* test:  test labels_to_array

* 🏷️ add type aliases for X and y

* 🚨 ignore type-checks for pandas indexing assertions

CI typechecker runs on Python 3.10 which gives this error:

'cleanlab/internal/validation.py:125: error: No overload variant of "__getitem__" of "_iLocIndexerSeries" matches argument type "List[int]"'

It should be fine to let mypy ignore these expressions as they don't return anything.

* 🥅 specify errors to ignore

"type: ignore" doesn't pass strict mypy type-checks unless the specific errors are provided

* 🏷️ annotate label series to array
2022-07-26 12:58:37 -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
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
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