code: def __init__(
      self,
      average: str = "macro",
      *,
      predictions_key: Optional[str] = PREDICTIONS_KEY,
  ):
      super().__init__(predictions_key=predictions_key)
      self.average = average
      if metrics is None:
          print_warning(
              "`scikit-learn` needs to be installed for `F1Score`"
          )
  
imports: import numpy
  from typing import Any
  from typing import Tuple
  from typing import Optional
  from cftool.misc import print_warning
  from cftool.array import iou
  from cftool.array import corr
  from cftool.array import softmax
  from cftool.array import get_full_logits
  from cftool.array import get_label_predictions
  from cftool.types import np_dict_type
  from .schema import IMetric
  from .schema import IDataLoader
  from .constants import LABEL_KEY
  from .constants import PREDICTIONS_KEY
  from .misc.toolkit import insert_intermediate_dims
label_desc: Use image node_id 1 to create a new F1Score object from inherited base classes: IMetric with example: obj = F1Score(average)