提交

提交图

1813 次代码提交

作者 SHA1 备注 提交日期
Jonas Mueller 6ab83fc37c language improvements (#380) 2022-08-30 16:38:56 -07:00
Hui Wen 960c2b4ac1 CL functionality for multiannotator data (#333)
* setup multiannotator functionality

* add docstring

* add unittests

* edit get label quality with nan helper func

* docstring edits

* handle non overlapping annotators in get_annotator_agreement_with_annotators

* return NaN annotator quality scores for non-overlapping annotators

* add unittest

* add unittests for get_consensus_label tiebreaks

* np.array -> np.ndarray

* add new annotator quality method

* docstring edits

* address comments, docstring changes

* add method to compute improved consensus labels

* separate detailed_label_quality return

* elif statement typo

* changed get_majority_vote_label

* add 'best_quality' as a consensus method

* change lqs kwargs naming

* change lqs kwargs naming

* change unittest function names

* docstring edits

* change get_worst_class to return class with lowest agreement with consensus

* edit method to get annotator lqs, change quality_of_consensus -> consensus_quality_score

* remove unnecessary args

* satisfy mypy checks

* fix mypy issue

* add unittests

* reshuffled order of functions

* address comments

* docstring edit

* change return to always return dict

* add clipping to prevent negative pred_probs

* add tutorial

* add multiannotator to tutorial index

* add newline

* add tiebreaks for best_quality labels and worst_class

* change auto method name to crowdlab

* fix indexing for non numeric anno names

* add test for nonnumeric anno names

* update unittest

* address comments [partially complete]

* edit metadata

* missing /details tag

* bugfix to allow pd Int64 types

* update tutorial

* address comments
2022-08-30 11:29:06 -07:00
Eric Wang 1bad2f82a2 Adding functionality for cleanlab to find label errors in token classification datasets (#347)
* add token_classification functionality

* add typing

* fix typing

* add typing

* fixed typing and black

* fix typing
2022-08-30 09:17:07 -07:00
Elías Snorrason e987ec190d switch docs links from latest release to stable (#379)
Find and replace 'docs.cleanlab.ai/v2.0.0/' with 'docs.cleanlab.ai/stable/'. Only occurs in README.md.
2022-08-25 16:45:00 -07:00
Elías Snorrason 0b5a089e37 fix typos in ci step names (#377)
[skip ci]
2022-08-24 09:01:20 -07:00
Jonas Mueller ba0110f29d projects link and getting started instructions (#349) 2022-08-23 01:07:21 -07:00
Hui Wen bf83c553bf make pred_probs naming consistent in tutorials (#345)
* rename cv_pred_probs to pred_probs

* revert python version
2022-08-17 19:52:25 -07:00
Eric Wang cccc8f8932 Fix capitalization in DEVELOPMENT.md (#340) 2022-08-16 14:30:25 -07:00
Ulyana 9abbb26bba Added mypy instructions to DEVELOPMENT.md guide (#339)
* Added mypy and black instructions

* Fixed typo

* Fixed capetalization

* Resolved PR comments
2022-08-15 23:01:36 -07: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
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 5b05bc5f62 update sphinx to v5 (#327)
* update sphinx to v5

* update autodocsumm version

* autodocsumm v0.2.9

* upgrade furo

Co-authored-by: calebchiam <calebchiam@gmail.com>
2022-08-08 03:14:28 -07:00
Jonas Mueller 104e72dc07 typo 2022-08-05 09:27:49 -07:00
Jonas Mueller 4efb7df63f missing/rare class comment (#332) 2022-08-03 12:52:09 -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 9a26254adc language improvements 2022-07-28 13:43:39 -07:00
Jonas Mueller 85844e55cd section headers in outlier tutorial 2022-07-28 00:11:05 -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
Jonas Mueller a0a8e15346 flip precision-recall plot (#326) 2022-07-27 16:37:24 -07:00
Jonas Mueller 86bedb39fa missing backtick 2022-07-26 17:54:17 -07:00
Ulyana c6feb2ff40 Improved versioning compatibility for audio tutorial (#325)
* Addressed issue @292
2022-07-26 15:58:19 -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
Curtis G. Northcutt 346d101acd Clarify language 2022-07-26 12:49:57 -07: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
Ulyana b481a74d0d Updated tutorials to include quickstart (#323)
* Added runnable package versioning for tutorials
Added quickstart at top of tutorials

* Addressed PR comments
* Fixed quickstart to include cleanlearning
* Set correct requirements.txt
* Updated y to labels

* Fixed y-> labels labeling issues

* Updated quickstart message/removed extra dependencies

* remove keras from package-versions

* more concise

* remove pathlib as explicit requirement

* remove pathlib version

* rewording

* true label -> given label

* remove venv from kernelspec

Co-authored-by: Jonas Mueller <1390638+jwmueller@users.noreply.github.com>
2022-07-26 00:52:13 -07:00
Jonas Mueller d8a207b971 remove broken links 2022-07-25 22:55:27 -07:00
Jonas Mueller 571f29ddcd model accuracy -> label error detection performance 2022-07-25 21:22:10 -07:00
Jonas Mueller 268e43e6ee Some FAQ tips on how to improve CleanLearning (#324)
* cleanlearning tips

* addessed comments

* add a few general tips at the end

* minor edits

* format pred_probs as variable type

* bug fix to pass lint (missing comma)

* fix format for linter

Co-authored-by: Curtis G. Northcutt <curtis.northcutt@gmail.com>
2022-07-25 21:12:50 -07:00
Jonas Mueller a0e1227ae5 Allow KNN object to be returned by get_outlier_scores, Improved Tutorial (#319)
* knn return, improved tutorial

* typing fix for tuple

* add timm to docs-requirements

* language improvements

* declare typing of outlier_scores
2022-07-25 12:40:58 -07:00
Jonas Mueller 5973a21958 revert links from master -> v2.0.0 2022-07-23 16:46:34 -07:00
Aravind Putrevu 85ca7302a9 Updating tutorials hyperlink to 2.0.0 release (#318)
* Updating tutorials hyperlink to 2.0.0 release

* revert back to v.2.0.0 links instead of stable

Co-authored-by: Jonas Mueller <1390638+jwmueller@users.noreply.github.com>
2022-07-23 16:36:01 -07:00
Jonas Mueller a18d4d2c71 patch missing timm in docs-requirements 2022-07-23 15:52:18 -07:00
Jonas Mueller 31545f1e5c More guidelines added to docs readme (#321)
* point to tutorial guidelines

* things not to forget for new tutorials

* docstring editing guidelines
2022-07-23 15:49:29 -07:00
Jonas Mueller 008ad080db Tips for editing the tutorial notebooks (#320)
* docs editing tips
2022-07-22 18:17:55 -07:00
Ulyana b8e85284c6 Added outlier detection tutorial into docs (#310)
* Added outlier detection tutorial into docs

* Switched to pytorch model/dataset implementation

* Fixed image normalization

* Fixed outlier detection for test set

* Added outlier thresholding into tutorial.

* Cleaned output

* Removed unused imports and renamed notebook

* Added outliers notebook to PR

* Added quickstart into tutorial

* Best quickstart header

* Cleaned cell output

* Changed to use subset of original data for speed

* Fixed randomness

* Cleared outputs

* fixed metadata tags

* Fixed metadata

* Cleaned kernel and verified output

* Improved unit test
Changed labels references to classes where apropriate
2022-07-22 15:40:03 -07:00
Curtis G. Northcutt af9902ace9 improve use experience remove link to tutorials (#316)
The previous link took you to a tutorials page with lots of options including tutorials that were for data-centric AI workflows, and computing cross validated probs, etc. if this is supposed to be the very first thing users click on to get started, we want it to take them straight to a place where they can get started in 5 minutes, not a list of things where they have to figure out what to click next.

Updated to fix this, which also reduced the length :)
2022-07-21 15:06:37 -07:00
Jonas Mueller a4f51327db fix KNN default k-value bugs (#315) 2022-07-21 15:00:51 -07:00
Jonas Mueller ffbe47835e update slack link (#313)
* update slack link

* slack links in docs

* slack link in ISSUE_TEMPLATE
2022-07-20 18:31:39 -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
Ulyana fef76ba357 Added support to build KNN graph with only training data (#305)
* Added support to build KNN graph with only training data
- Added default classifier for get_knn_distance_ood_scores()

* Added unit test for checking default KNN model is used when nbrs=None

* Changed default num neighbors from 10 to K.

* Changed unit test to check score sums

* Fixed k=15

* Added support to build KNN graph with only training data

- Added default classifier for get_knn_distance_ood_scores()

- Added unit test for checking default KNN model is used when nbrs=None

- Changed default num neighbors from 10 to K.

- Changed unit test to check score sums

* Improved code readibility, extended unit test to check for default k

* Changed naming convention from get_knn_distance_ood_scores to get_outlier_scores

- Changed nbrs to knn
- Improved unit test readability

* Made unit test more robust to check if user-set value is passed

* changed classifier -> estimator
* fixed test warning handle

* Updated function headers to better definition

* Improved header writing added functionality to avoid training/testing with identical features

* Updated docstring, updated handling of features=None and test for it

* Added ValueError for k>len(features) and test to catch ValueError

* Updated argument types to Optional, added runtime typecheck.

* Added unit test to check TypeError

* Changed Exception type thrown when knn=None, features=None

* TypeError to ValueError

* Reversed scoring for outlier severity
* Added test to check t parameter
* Added t parameter for global rescaler

* Improved function definition concerning 't' parameter

* Fixed tests
* Removed repeated calls
* Added assertion to make sure X_ood is always smallest outlier score

* Improved logic for checking X_ood has the smallest score
2022-07-14 10:36:10 -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
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
Ulyana 36bfddc354 Added 4 more FAQs to faq doc (#303)
* Added new questions in FAQ

* Added 4 other FAQs

* language / code-format edits

Co-authored-by: Jonas Mueller <1390638+jwmueller@users.noreply.github.com>
2022-07-01 18:01:48 -07:00
Ulyana f7328e8b67 Created FAQ Page in the Cleanlab documentation (#294)
* Create FAQ page in cleanlab docs

* Add FAQ notebook to store answers to frequently asked questions

* Improved formatting issues for faq page

- added faq to sidebar

* Improved formatting issues for faq page

- added faq to sidebar
- changed email to comply with CLA

* Removed faq numbering

- Removed notebook output metadata
- Added notebook to index for left table link

* Text and example rewritten for clarity

- How do I format labels for cleanlab-- example improved
- How do I format labels for cleanlab-- text amended
- Can't find an answer to your question-- added links

* add links to issues/slack

Co-authored-by: Ulyana Tkachenko <uly@ulyana.lan>
Co-authored-by: Jonas Mueller <1390638+jwmueller@users.noreply.github.com>
2022-06-29 10:24:50 -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