class_docstr: A default model selection implementation.
  
  .. versionadded:: 1.1.0
docstr: Parameters
  ----------
  default_select_by : str or list of str
      Metric or list of metrics. In case a list is given, the model selection starts with
      the first metric and switches to the next one in case of a tie.
  metrics : list of small_text.training.metrics.Metric
      The metrics whose measured values which will be used for deciding which model to use.
  required : list of str
      Names of the metrics given by `metrics` that are required.
      Non-required metrics can be reported as `None`.
  fields_config : dict of str to type
      A configuration for additional data fields that can be measured and taken
      into account when selecting the model. Fields can be None by default but can be
      required by model selection strategies.
docstr_tok: ["Parameters","--","--","--","--","--","default_select_by",":","str","or","list","of","str","Metric","or","list","of","metrics",".","In","case","a","list","is","given",",","the","model","selection","starts","with","the","first","metric","and","switches","to","the","next","one","in","case","of","a","tie",".","metrics",":","list","of","small_text.training.metrics.Metric","The","metrics","whose","measured","values","which","will","be","used","for","deciding","which","model","to","use",".","required",":","list","of","str","Names","of","the","metrics","given","by","`","metrics","`","that","are","required",".","Non-required","metrics","can","be","reported","as","`","None","`",".","fields_config",":","dict","of","str","to","type","A","configuration","for","additional","data","fields","that","can","be","measured","and","taken","into","account","when","selecting","the","model",".","Fields","can","be","None","by","default","but","can","be","required","by","model","selection","strategies","."]
code: def __init__(
      self,
      default_select_by=DEFAULT_DEFAULT_SELECT_BY,
      metrics=DEFAULT_METRICS,
      required=DEFAULT_REQUIRED_METRIC_NAMES,
      fields_config=dict(),
  ):
      """
      Parameters
      ----------
      default_select_by : str or list of str
          Metric or list of metrics. In case a list is given, the model selection starts with
          the first metric and switches to the next one in case of a tie.
      metrics : list of small_text.training.metrics.Metric
          The metrics whose measured values which will be used for deciding which model to use.
      required : list of str
          Names of the metrics given by `metrics` that are required.
          Non-required metrics can be reported as `None`.
      fields_config : dict of str to type
          A configuration for additional data fields that can be measured and taken
          into account when selecting the model. Fields can be None by default but can be
          required by model selection strategies.
      """
      if ModelSelection.FIELD_NAME_EARLY_STOPPING in fields_config:
          raise ValueError(
              f"Name conflict for field {ModelSelection.FIELD_NAME_EARLY_STOPPING} "
              f"which already exists as a default field."
          )
  
      if isinstance(default_select_by, str):
          default_select_by = [default_select_by]
      self._verify_select_by(metrics, required, default_select_by)
      self.default_select_by = default_select_by
  
      self.metrics = metrics
      self.required = set(required)
      self._verify_metrics(self.metrics, required)
  
      self._fields_config = {
          **fields_config,
          **{ModelSelection.FIELD_NAME_EARLY_STOPPING: bool},
      }
  
      names = (
          ["model_id", "model_path"]
          + [metric.name for metric in self.metrics]
          + list(self._fields_config.keys())
      )
      formats = (
          [object, object]
          + [metric.dtype for metric in self.metrics]
          + list(self._fields_config.values())
      )
  
      self.dtype = {"names": names, "formats": formats}
  
      self.last_model_id = None
      self.models = np.empty((0,), dtype=self.dtype)
  
imports: import numpy
  from abc import ABC
  from small_text.training.metrics import Metric
label_desc: Use image node_id 1 to create a new ModelSelection object from inherited base classes: ModelSelectionManager with example: obj = ModelSelection(default_select_by, metrics, required, fields_config)