gemseo.utils.metrics.mean_metric module#

A mean metric.

A mean metric applies the mean operator on the result returned by ElementWiseMetric.compute().

class MeanMetric(metric)[source]#

Bases: BaseCompositeMetric[_InputT, ndarray[Any, dtype[number[Any]]]]

The mean of an element-wise metric.

Initialize self. See help(type(self)) for accurate signature.

Parameters:

metric (BaseCompositeMetric[Any, Any]) -- The metric applied at element level.

compute(a, b)[source]#

Evaluate the metric.

Parameters:
  • a (_InputT) -- A first quantity.

  • b (_InputT) -- A second quantity.

Returns:

The metric associated with a and b.

Return type:

ndarray[Any, dtype[number[Any]]]