Skip to main content

mb.add_metrics(name, metrics, ...)

Adds or updates metrics for a model in the registry.

Include metrics with the model

You can include metrics with your models when adding them to the registry with mb.add_model and mb.add_models.


  • name: str The name of the model in the registry.
  • metrics: Dict[str, Any] The metrics to associate with this model. Metrics must be JSON-serializable with str values for keys.
  • update: Optional[merge|overwrite] Optional. Choose whether to merge the supplied metrics with any metrics already exist, or overwrite the current metrics with what's supplied in this call. Default is merge.


No value is returned. A success status message is printed if the command is successful.


Adding metrics to a model

This will merge precision and recall metrics with any existing metrics associated with example_model.

mb.add_metrics("example_model", metrics={ "precision": 0.95, "recall": 0.81 })

Overwriting a model's metrics

After this call, the only metrics associated with example_model will be precision.

mb.add_metrics("example_model", metrics={ "precision": 0.90 }, update="overwrite")

See also