Skip to main content

mb.get_metrics(nameOrNames)

Retrieves the metrics associated with one or more models. Metrics must have been added with the model when it was saved with mb.add_model or mb.add_models.

Parameters

  • nameOrNames: Union[str, List[str]] The names of the models for fetching metrics. This can be one model name (str) or a list of model names (List[str]). The input format affects the output format.

Returns

Dict[str, Any] - If this method is called with a str model name then that model's metrics, if any, are returned. If this method is called with a list of model names then a dictionary of { modelName: modelMetrics } is returned.

Examples

Get one model's metrics

mb.get_metrics("example_model")
# returns { "metric1": 1, "metric2": 2 }

Get several models' metrics

mb.get_metrics(["example_model", "other_model"])
# returns
# {
# "example_model": { "metric1": 1, "metric2": 2 },
# "other_model": { ... }
# }

See also