class_docstr: Micro-average precision score.
  
  The micro-average precision score is exactly equivalent to the micro-average recall as well as
  the micro-average 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.
  
  Examples
  --------
  
  >>> from river import metrics
  
  >>> y_true = [0, 1, 2, 2, 2]
  >>> y_pred = [0, 0, 2, 2, 1]
  
  >>> metric = metrics.MicroPrecision()
  
  >>> for yt, yp in zip(y_true, y_pred):
  ...     metric.update(yt, yp)
  ...     print(metric)
  MicroPrecision: 100.00%
  MicroPrecision: 50.00%
  MicroPrecision: 66.67%
  MicroPrecision: 75.00%
  MicroPrecision: 60.00%
  
  References
  ----------
  [^1]: [Why are precision, recall and F1 score equal when using micro averaging in a multi-class problem?](https://simonhessner.de/why-are-precision-recall-and-f1-score-equal-when-using-micro-averaging-in-a-multi-class-problem/)
class_docstr_tok: ["Micro-average","precision","score",".","The","micro-average","precision","score","is","exactly","equivalent","to","the","micro-average","recall","as","well","as","the","micro-average","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",".","Examples","--","--","--","--",">",">",">","from","river","import","metrics",">",">",">","y_true","=","[","0",",","1",",","2",",","2",",","2","]",">",">",">","y_pred","=","[","0",",","0",",","2",",","2",",","1","]",">",">",">","metric","=","metrics.MicroPrecision","(",")",">",">",">","for","yt",",","yp","in","zip","(","y_true",",","y_pred",")",":","...","metric.update","(","yt",",","yp",")","...","print","(","metric",")","MicroPrecision",":","100.00","%","MicroPrecision",":","50.00","%","MicroPrecision",":","66.67","%","MicroPrecision",":","75.00","%","MicroPrecision",":","60.00","%","References","--","--","--","--","--","[","^1","]",":","[","Why","are","precision",",","recall","and","F1","score","equal","when","using","micro","averaging","in","a","multi-class","problem","?","]","(","https",":","\/\/simonhessner.de\/why-are-precision-recall-and-f1-score-equal-when-using-micro-averaging-in-a-multi-class-problem\/",")"]
code: def get(self):
      tp = self.cm.total_true_positives
      fp = self.cm.total_false_positives
      try:
          return tp / (tp + fp)
      except ZeroDivisionError:
          return 0.0
  
file_path: river/river/metrics/precision.py
imports: from __future__ import annotations
  from river import metrics
label_desc: Use image node_id 1 for calling the MicroPrecision obj's underlying member method code with example usage: obj.get() and returns: unknown, int