class_docstr: Same as `HorizonMetric`, but aggregates the result based on an provided function.
  
  This allows, for instance, to measure the average performance of a forecasting model along the
  horizon.
  
  Parameters
  ----------
  metric
      A regression metric.
  agg_func
      A function that takes as input a list of floats and outputs a single float. You may want to
      `min`, `max`, as well as `statistics.mean` and `statistics.median`.
  
  Examples
  --------
  
  This is used internally by the `time_series.evaluate` function when you pass an `agg_func`.
  
  >>> import statistics
  >>> from river import datasets
  >>> from river import metrics
  >>> from river import time_series
  
  >>> metric = time_series.evaluate(
  ...     dataset=datasets.AirlinePassengers(),
  ...     model=time_series.HoltWinters(alpha=0.1),
  ...     metric=metrics.MAE(),
  ...     agg_func=statistics.mean,
  ...     horizon=4
  ... )
  
  >>> metric
  mean(MAE): 42.901748
class_docstr_tok: ["Same","as","`","HorizonMetric","`",",","but","aggregates","the","result","based","on","an","provided","function",".","This","allows",",","for","instance",",","to","measure","the","average","performance","of","a","forecasting","model","along","the","horizon",".","Parameters","--","--","--","--","--","metric","A","regression","metric",".","agg_func","A","function","that","takes","as","input","a","list","of","floats","and","outputs","a","single","float",".","You","may","want","to","`","min","`",",","`","max","`",",","as","well","as","`","statistics.mean","`","and","`","statistics.median","`",".","Examples","--","--","--","--","This","is","used","internally","by","the","`","time_series.evaluate","`","function","when","you","pass","an","`","agg_func","`",".",">",">",">","import","statistics",">",">",">","from","river","import","datasets",">",">",">","from","river","import","metrics",">",">",">","from","river","import","time_series",">",">",">","metric","=","time_series.evaluate","(","...","dataset=datasets.AirlinePassengers","(",")",",","...","model=time_series.HoltWinters","(","alpha=0.1",")",",","...","metric=metrics.MAE","(",")",",","...","agg_func=statistics.mean",",","...","horizon=4","...",")",">",">",">","metric","mean","(","MAE",")",":","42.901748"]
code: def __repr__(self):
      name = (
          f"{self.agg_func.__name__}({self.metric.__class__.__name__})"
      )
      return f"{name}: {self.get():{self.metric._fmt}}".rstrip("0")
  
imports: from __future__ import annotations
  import abc
  import typing
  from numbers import Number
  from river import base, metrics
label_desc: Use image node_id 3 for calling the HorizonAggMetric obj's underlying member method code with example usage: obj.__repr__() and returns: name, str, self