Skip to main content
Sometimes you need to generate multiple column-level Tests or Metrics. To simplify this, you can use metric generator helper functions. Pre-requisites:

Imports

Use the following code to generate toy data for this guide.
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 - numerical
  • cat - categorical
  • all - 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.