climpred.metrics.Metric

climpred.metrics.Metric

class climpred.metrics.Metric(name: str, function: Callable, positive: Optional[bool], probabilistic: bool, unit_power: float, long_name: Union[None, str] = None, aliases: Optional[List[str]] = None, minimum: Optional[float] = None, maximum: Optional[float] = None, perfect: Optional[float] = None, normalize: bool = False, allows_logical: bool = False, requires_member_dim: bool = False)[source]

Master class for all metrics. See Metrics.

__init__(name: str, function: Callable, positive: Optional[bool], probabilistic: bool, unit_power: float, long_name: Union[None, str] = None, aliases: Optional[List[str]] = None, minimum: Optional[float] = None, maximum: Optional[float] = None, perfect: Optional[float] = None, normalize: bool = False, allows_logical: bool = False, requires_member_dim: bool = False)[source]

Metric initialization. See Metrics.

Parameters
  • name – name of metric.

  • function – metric function.

  • positive – Is metric positively oriented? If True, higher skill value means better skill. If False, lower metric value means better skill. None if different differentiation.

  • probabilistic – Is metric probabilistic? False means deterministic.

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

  • long_name – long name of metric. Defaults to None.

  • aliases – Allowed aliases for this metric. Defaults to None.

  • min – Minimum skill for metric. Defaults to None.

  • max – Maxmimum skill for metric. Defaults to None.

  • perfect – Perfect skill for metric. Defaults to None.

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

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

  • requires_member_dim – Does xskillscore.metric expect a member dimension? Defaults to False.

Methods

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

Metric initialization.