class_docstr: Base class for scoring.
  
  Subclass and implement an ``on_*`` method before using.
class_docstr_tok: ["Base","class","for","scoring",".","Subclass","and","implement","an","``","on_","*","``","method","before","using","."]
code: def on_train_begin(self, net, X, y, **kwargs):
      self.X_indexing_ = check_indexing(X)
      self.y_indexing_ = check_indexing(y)
  
      # Looks for the right most index where `*_best` is True
      # That index is used to get the best score in `net.history`
      with suppress(ValueError, IndexError, KeyError):
          best_name_history = net.history[
              :, "{}_best".format(self.name_)
          ]
          idx_best_reverse = best_name_history[::-1].index(True)
          idx_best = len(best_name_history) - idx_best_reverse - 1
          self.best_score_ = net.history[idx_best, self.name_]
  
imports: from contextlib import contextmanager
  from contextlib import suppress
  from functools import partial
  import warnings
  import numpy
  import sklearn
  from sklearn.metrics import make_scorer, check_scoring
  from skorch.callbacks import Callback
  from skorch.dataset import unpack_data
  from sklearn.metrics._scorer import _BaseScorer
  from skorch.utils import data_from_dataset
  from skorch.utils import is_skorch_dataset
  from skorch.utils import to_numpy
  from skorch.utils import check_indexing
  from skorch.utils import to_device
label_desc: Use image node_id 4 for calling the ScoringBase obj's underlying member method code with example usage: obj.on_train_begin(net, X, y) without return types