report#

Note

This module is not intended to be used directly by users. It is used by the cleanlab.datalab.datalab module. Specifically, it is used by the Datalab.report method.

Module that handles reporting of all types of issues identified in the data.

Classes:

Reporter(data_issues[, verbosity, ...])

Class that generates a report about the issues stored in a DataIssues object.

class cleanlab.datalab.report.Reporter(data_issues, verbosity=1, include_description=True, show_summary_score=False)[source]#

Bases: object

Class that generates a report about the issues stored in a DataIssues object.

Parameters:
  • data_issues (DataIssues) – The DataIssues object containing the issues to report on. This is usually generated by the Datalab class, stored in the data_issues attribute, and then passed to the Reporter class to generate a report.

  • verbosity (int) – The default verbosity of the report to generate. Each :py:class`IssueManager` specifies the available verbosity levels and what additional information is included at each level.

  • include_description (bool) – Whether to include the description of each issue type in the report. The description is included by default, but can be excluded by setting this parameter to False.

Note

This class is not intended to be used directly. Instead, use the Datalab.find_issues method which internally utilizes an IssueFinder instance.

Methods:

report(num_examples)

Prints a report about identified issues in the data.

get_report(num_examples)

Constructs a report about identified issues in the data.

report(num_examples)[source]#

Prints a report about identified issues in the data.

Parameters:

num_examples (int) – The number of examples to include in the report for each issue type.

Return type:

None

get_report(num_examples)[source]#

Constructs a report about identified issues in the data.

Parameters:

num_examples (int) – The number of examples to include in the report for each issue type.

Return type:

str

Returns:

report_str – A string containing the report.

Examples

>>> from cleanlab.datalab.report import Reporter
>>> reporter = Reporter(data_issues=data_issues, include_description=False)
>>> report_str = reporter.get_report(num_examples=5)
>>> print(report_str)