class_docstr: A `Callback` that keeps track of the best value in `monitor`.
class_docstr_tok: ["A","`","Callback","`","that","keeps","track","of","the","best","value","in","`","monitor","`","."]
docstr: Prepare the monitored value
docstr_tok: ["Prepare","the","monitored","value"]
code: def before_fit(self):
      "Prepare the monitored value"
      self.run = not hasattr(self, "lr_finder") and not hasattr(
          self, "gather_preds"
      )
      if self.reset_on_fit or self.best is None:
          self.best = (
              float("inf") if self.comp == np.less else -float("inf")
          )
      assert self.monitor in self.recorder.metric_names[1:]
      self.idx = list(self.recorder.metric_names[1:]).index(
          self.monitor
      )
  
imports: from __future__ import annotations
  from ..basics import *
  from .progress import *
  from .fp16 import MixedPrecision
label_desc: Use image node_id 2 for calling the TrackerCallback obj's underlying member method code with example usage: obj.before_fit() without return types