validmind.unit_metrics

def describe_metric(metric_id, raw=False):

Describe a metric

Arguments:
  • metric_id (str): The metric id (e.g. 'validmind.unit_metrics.classification.F1')
  • raw (bool): Whether to return the description as a dictionary
Returns:

dict: A dictionary containing the metric description

def list_metrics():

List all available metrics

Returns:

list: A list of metric ids

def load_metric(metric_id):

Load a metric class from a string

Arguments:
  • metric_id (str): The metric id (e.g. 'validmind.unit_metrics.classification.F1')
Returns:

callable: The metric function

def run_metric(metric_id, inputs=None, params=None, show=True, value_only=False):

Run a single metric and cache the results

Arguments:
  • metric_id (str): The metric id (e.g. 'validmind.unit_metrics.classification.F1')
  • inputs (dict): A dictionary of the metric inputs
  • params (dict): A dictionary of the metric parameters
  • show (bool): Whether to display the results
  • value_only (bool): Whether to return only the value