climpred.metrics.Metric

class climpred.metrics.Metric(name, function, positive, probabilistic, unit_power, long_name=None, aliases=None, minimum=None, maximum=None, perfect=None, normalize=False, allows_logical=False, requires_member_dim=False)[source]

Master class for all metrics.

__init__(name, function, positive, probabilistic, unit_power, long_name=None, aliases=None, minimum=None, maximum=None, perfect=None, normalize=False, allows_logical=False, requires_member_dim=False)[source]

Metric initialization.

Parameters
  • name (str) – name of metric.

  • function (function) – metric function.

  • positive (bool) – Is metric positively oriented? If True, higher metric value means better skill. If False, lower metric value means better skill.

  • probabilistic (bool) – Is metric probabilistic? False means deterministic.

  • unit_power (float, int) – Power of the unit of skill based on unit of input, e.g. input unit [m]: skill unit [(m)**unit_power]

  • long_name (str, optional) – long_name of metric. Defaults to None.

  • aliases (list of str, optional) – Allowed aliases for this metric. Defaults to None.

  • min (float, optional) – Minimum skill for metric. Defaults to None.

  • max (float, optional) – Maxmimum skill for metric. Defaults to None.

  • perfect (float, optional) – Perfect skill for metric. Defaults to None.

  • normalize (bool, optional) – Will the metric be normalized? Then metric function will require to get Comparison passed. Defaults to False.

  • allows_logical (bool, optional) – Does the metric allow a logical to be passed in metric_kwargs? Some probabilistic metrics allow this. Defaults to False.

  • requires_member_dim (bool, optional) – Does xskillscore.metric expect a member dimension?

Returns

metric class Metric.

Return type

Metric

Methods

__init__(name, function, positive, …[, …])

Metric initialization.