class_docstr: Binary F1 score.
  
  Parameters
  ----------
  cm
      This parameter allows sharing the same confusion
      matrix between multiple metrics. Sharing a confusion matrix reduces the amount of storage
      and computation time.
  pos_val
      Value to treat as "positive".
  
  Examples
  --------
  
  >>> from river import metrics
  
  >>> y_true = [False, False, False, True, True, True]
  >>> y_pred = [False, False, True, True, False, False]
  
  >>> metric = metrics.F1()
  
  >>> for yt, yp in zip(y_true, y_pred):
  ...     metric.update(yt, yp)
  
  >>> metric
  F1: 40.00%
class_docstr_tok: ["Binary","F1","score",".","Parameters","--","--","--","--","--","cm","This","parameter","allows","sharing","the","same","confusion","matrix","between","multiple","metrics",".","Sharing","a","confusion","matrix","reduces","the","amount","of","storage","and","computation","time",".","pos_val","Value","to","treat","as","``","positive","''",".","Examples","--","--","--","--",">",">",">","from","river","import","metrics",">",">",">","y_true","=","[","False",",","False",",","False",",","True",",","True",",","True","]",">",">",">","y_pred","=","[","False",",","False",",","True",",","True",",","False",",","False","]",">",">",">","metric","=","metrics.F1","(",")",">",">",">","for","yt",",","yp","in","zip","(","y_true",",","y_pred",")",":","...","metric.update","(","yt",",","yp",")",">",">",">","metric","F1",":","40.00","%"]
code: def __init__(self, cm=None, pos_val=True):
      super().__init__(beta=1.0, cm=cm, pos_val=pos_val)
  
imports: from __future__ import annotations
  import collections
  import functools
  from river import metrics
label_desc: Use image node_id 1 to create a new F1 object from inherited base classes: FBeta with example: obj = F1(cm, pos_val)