Metric generators
How to generate multiple metrics at once.
Sometimes you need to generate multiple column-level Tests or Metrics. To simplify this, you can use metric generator helper functions.
Pre-requisites:
- You know how to generate Reports.
Imports
Imports
Metric generators
Example 1. Apply the selected metric (ValueDrift
) to all columns in the dataset.
Example 2. Apply the selected metric (ValueDrift
) to the listed columns in the dataset. Use metric_kwargs
to pass any applicable metric parameters.
Example 3. Apply the selected metric (ValueDrift
) only to the categorical (cat
) columns in the dataset.
Available:
num
- numericalcat
- categoricalall
- all
Test generators
You can use the same approach to generate Tests. Use metric_kwargs
to pass test conditions.
Example. Generate the same Test for all the columns in the dataset. It will use defaults if you do not specify the test condition.
This will apply the minimum value test to all numerical columns in the dataset and check that they are above 0.