文件历史

提交图

293 次代码提交

作者 SHA1 备注 提交日期
Hui Wen bee40afd38 Doc edits: change header size in tutorials and better supress tf errors (#484) 2022-09-28 21:27:53 -07:00
Jonas Mueller 34acd0f19f tf-io tutorial version pinned, docstring improvements [include in 2.1 docs] (#466) 2022-09-22 14:37:44 -07:00
Ulyana 5da046da9e Added support for returning ranked issue idxs (#459)
* Added support for returning ranked issue idxs
- code
- tests
- docstring

Co-authored-by: Jonas Mueller <1390638+jwmueller@users.noreply.github.com>
Co-authored-by: Curtis G. Northcutt <curtis.northcutt@gmail.com>
2022-09-16 20:20:52 -07:00
Anish Athalye 02ab55dff0 Add missing backticks and language annotation (#461) 2022-09-16 18:52:36 -07:00
Jonas Mueller 2eec20ea44 remove moderate dimension comment 2022-09-16 15:14:00 -07:00
Anish Athalye d8cc2e5056 Fix details disclosure elements in docs (#456)
This patch makes the following fixes:

- Make summary text appear on the same line as the ">" arrow marker;
  prior to this patch, it was being pushed down to the next line because
  there were nested block elements inside the <summary> element
- Style details element to visually delineate collapsible content with
  dashed lines above and below the content
- Add syntax highlighting for code blocks in details disclosure elements
  (some were missing syntax highlighting)
- Hide a cell that was meant to be hidden in the audio tutorial

The summary element looked ugly due to a block element being present
inside the <summary>. This was present in the rendered docs even though
it was not explicitly in the source. Even though our source (in a
Markdown cell in a Jupyter notebook) looked like:

    <summary>Example text</summary>

The rendered docs had:

    <summary><p>Example text</p></summary>

The easy fix was to leave this as-is and fix the styling with CSS,
making all elements inside the summary to be displayed as inline
elements.

Where was the extra <p> tag coming from? Different Markdown parsers
handle mixed Markdown/HTML differently. We are using nbsphinx, which
does something especially weird [1]: converting from Markdown ->
reStructuredText -> HTML.

For example, consider the following Markdown:

    <details><summary>Summary</summary>

    Body.

    </details>

nbsphinx was first converting it to this reST:

    .. raw:: html

       <details>

    .. raw:: html

       <summary>

    Summary

    .. raw:: html

       </summary>

    Body.

    .. raw:: html

       </details>

And then this reST was being converted to HTML. This is where the extra
<p> was coming from.

One workaround for this behavior is to switch to raw HTML cells in the
notebook, rather than Markdown cells, and write pure HTML there. This
has the disadvantage that it's inconvenient when the content inside the
<details> has extra markup: Markdown is very convenient for that (e.g.,
for styling text), and having the contents being parsed as Markdown also
allows us to easily use syntax highlighting inside the body.

Another workaround is to use raw reST cells [2] and write the proper
reST directly (avoiding the bad Markdown -> reST conversion). This
preserves the ability to use convenient formatting (though with reST
instead of Markdown) as well as syntax-highlighted code blocks. For
example:

    .. raw:: html

        <details><summary>Summary</summary>

    .. code-block:: python

        def meaning_of_life():
            return 42

    .. raw:: html

        </details>

The above snippet produces the expected HTML, with syntax-highlighted
code in the body, and without the extra <p> inside the <summary>.

Rather than either of these workarounds, the most convenient one for
developers is to fix the issue using CSS, so that the Markdown cells in
the tutorials can be left as-is and no special care is required when
writing details disclosure elements, which is what this patch does.

[1]: https://github.com/spatialaudio/nbsphinx/blob/fc79fd1ac5ab6df225b256ef4ca203c58c5ad92b/src/nbsphinx.py#L1309
[2]: https://nbsphinx.readthedocs.io/en/0.8.9/raw-cells.html#reST
2022-09-16 12:11:05 -07:00
Jonas Mueller a24dda5da8 clarify features for multiannotator tutorial 2022-09-16 11:22:02 -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 688c39c202 hide redundant display_example in audio tutorial 2022-09-16 04:09:15 -07:00
Jonas Mueller 5d900200e5 mention make_data in multiannotator tutorial 2022-09-16 03:46:03 -07:00
Elías Snorrason 5167d23b71 Update links to example notebooks (#444)
Related to cleanlab/examples#21
2022-09-15 11:10:33 -04:00
Hui Wen d74dda0ed9 fix code and md inconsistency (#442) 2022-09-14 14:45:09 -07:00
Jonas Mueller 84af558e85 hide more code in image tutorial, organize imports 2022-09-13 12:39:43 -07:00
Jonas Mueller 6a0e3bc461 Improvements to token_classification tutorial (#419)
* edits to token tutorial

* fix typos

* given_labels -> labels in quickstart block

* add IOB2-formatting clarification

Co-authored-by: Elías Snorrason <eliassno@gmail.com>
2022-09-13 09:34:33 -07:00
Jonas Mueller b9ab4ba57b suppress tensorflow warning logs in tutorials if not properly installed (#432)
* remove ineffective TF suppression lines

* suppress tensorflow logs in workflows tutorial

* formatting

* hidden cell comment

* move suppress code to hidden cell

* move suppression code to first hidden cell

* move suppression code to first cell

* supress tf logs in tabular tutorial

* optional code to hidden cells in audio tutorial

* suppress tf logs in multiannotator tutorial

* suppress tf logs in token tutorial

* move cross-val tutorial to appear last

* move cross-val tutorial to be last in main index

* move outlier before multiannotator in API list

* remove newline at end of cell
2022-09-13 00:47:21 -07:00
Jonas Mueller 15899f8f20 try to suppress tensorflow logs pt2 (#431)
* move env variable setting before tf import

* suppress tf logs in faq
2022-09-12 18:03:00 -07:00
Jonas Mueller a0276ca587 Text tutorial improvements (#429)
* more tf supression

* formatting

* move imports to top
2022-09-11 14:46:04 -07:00
Elías Snorrason 9a109182b1 Update argument given_labels -> labels in token classification module (#423)
* given_labels -> labels

only applies to the argument to `display_issues`

Fixes #418

* update kwargs in test for display_issues

* apply black formatter
2022-09-11 12:38:38 -07:00
Jonas Mueller f7102db902 Add links to examples notebooks where appropriate (#428)
* links to OOD examples notebook

* iterative notebook title in its link
2022-09-11 12:24:51 -07:00
Jonas Mueller c307e9714f update workflows for post 2.0 (#427)
* update workflows for post 2.0

* formatting

* link for cleanlearning
2022-09-11 00:27:57 -07:00
Jonas Mueller 78e8496363 Small tutorial notebook fixes/improvements (#420) 2022-09-09 17:36:27 +01:00
Hui Wen d8147caded Polish multiannotator docs (#422)
* docstring formatting

* add tiebreak info

* add example link to tutorial

* add missing backticks

* minor docstring text edits

* clarify "task"

Co-authored-by: Jonas Mueller <1390638+jwmueller@users.noreply.github.com>
2022-09-09 09:15:54 -07:00
Elías Snorrason 44cd416a96 add tutorial notebook to docs.cleanlab.ai (#411) 2022-09-08 18:27:28 -07:00
Elías Snorrason ce90af35c6 Review tutorial for token classification (#410)
* review tutorial for token classification

- update labels variable name in markdown block
- add newline for rendering bullet points
- put pulldown content into code blocks
- hide code blocks and move filepaths variable

* resolve pr comments

* remove pulldown code snippet and todo

* fix notebook json - delete extra comma

Co-authored-by: Jonas Mueller <1390638+jwmueller@users.noreply.github.com>
2022-09-08 18:27:11 -07:00
Ulyana 9dfa001068 Implementing get_ood_scores function (#338)
* Added base structure outline for get_ood_scores()
Added base test for get_ood_scores()

* Added warning for illogical param combo

* Addressed PR comments

* Added better unit tests
* TODO: test for correctly identifying OOD example

* Moved logic from get_ood_scores to _subtract_confident_thresholds

* TODO: Is this a cleaner way of doing this? Minimal code repeat but strange change to _subtract function
* Addressed type issue

* Switched logic for getting confident thresholds

* Fixing typecheck issues wiht labels parameter being None

* Simplified helper function. Testing type

* Fixed mypy static typing issue

* Mypy typecheck logic test

* removed uncessesary imports in util file

* typechecker debugging (add assert)

* Fixed type logic and removed confident_thresholds=None return

* Added extra arg in helper func to end of func

* Added zero-index checking for label param

* Added ood examples to outlier score notebook

* Added skeleton file structure for implementing outliers

* Make adjust_pred_probs=True by default not false

* Added base Outlier class functionality

TODO:
* test_outlier.py

* Added logic tests for function

* Updated get_ood_scores to always return confident_thresholds
* Even if none were calculated (then return is None)

* Added warning for fit that doesn't calculate confident_thresholds

* Moved get_outlier_scores and get_ood_scores to outlier.py

* Changed param dicts to dicts

* Added docstring to outlier.py

* Added proper return types

* Fixed mypy typing issues

* Switched outliers -> features; ood -> predictions naming conv

* Switched docstring to stem from fit and score functions

* Changed return of helper functions

* Fixed tutorials notebook to use OutOfDistribution class

* Moved imports to top of file

* Added option for different knn objects, addressed pr comments

* Switched params arg to init only

* Addressed PR comment for notebook, cleared notebook

* Fixed PR comments, wording.

* Testing relative links on build

* Changed ood_pred_probs scores to reflect 0 = most ood 1 = least

* Added MLP for detection outliers with pred_probs

* Fixed typos

* Added MLP Import

* Improved warning when fit call unnecessary

* Changed referenced to params dict in warnings/errors

* Added bagging+MLP classifier into notebook

* Reverted tutorial wording

* OOD tutorial improvements

* cleanup OOD documentation

* adopting->using

Co-authored-by: Jonas Mueller <1390638+jwmueller@users.noreply.github.com>
2022-09-07 10:52:55 -07:00
Jonas Mueller f77f25f5a2 re-add hidden cell metadata 2022-09-06 15:40:26 -07:00
Jonas Mueller 92427d10b3 set data to None to avoid warning 2022-09-06 14:06:41 -07:00
Jonas Mueller bc8de13927 also demonstrate cleanlearning with pred_probs
Thanks @elisno for the suggestion!
2022-09-06 14:01:58 -07:00
Jonas Mueller 1375a27beb faq on predicted labels (#402) 2022-09-06 13:35:30 -07:00
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
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
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 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 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
Curtis G. Northcutt 346d101acd Clarify language 2022-07-26 12:49:57 -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
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
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
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