class_docstr: When called, this ensemble will return the mode prediction from the entire list of underlying mixers.
  
  If there are multiple modes, the mode whose voting mixers have the highest score will be returned.
  
  NOTE: can only be used in categorical tasks.
code: def __init__(
      self,
      target,
      mixers: List[BaseMixer],
      data: EncodedDs,
      dtype_dict: dict,
      accuracy_functions,
      args: PredictionArguments,
      ts_analysis: Optional[dict] = None,
      fit: Optional[bool] = True,
      **kwargs,
  ) -> None:
      super().__init__(target, mixers, data, fit=False)
      self.mixer_scores = {}
  
      if fit:
          if dtype_dict[target] not in (
              dtype.binary,
              dtype.categorical,
              dtype.tags,
          ):
              raise Exception(
                  "This ensemble can only be used in classification problems! "
                  + f"Got target dtype {dtype_dict[target]} instead!"
              )
  
          for _, mixer in enumerate(mixers):
              score_dict = evaluate_accuracies(
                  data.data_frame,
                  mixer(data, args)["prediction"],
                  target,
                  accuracy_functions,
                  ts_analysis=ts_analysis,
              )
              avg_score = np.mean(list(score_dict.values()))
              log.info(
                  f"Mixer: {type(mixer).__name__} got accuracy: {avg_score}"
              )
  
              if is_nan_numeric(avg_score):
                  avg_score = -pow(2, 63)
                  log.warning(
                      f"Change the accuracy of mixer {type(mixer).__name__} to valid value: {avg_score}"
                  )
  
              self.mixer_scores[
                  f"__mdb_mixer_{type(mixer).__name__}"
              ] = avg_score
          self.prepared = True
  
file_path: lightwood/lightwood/ensemble/mode_ensemble.py
imports: from typing import List, Optional, Dict
  import pandas
  import numpy
  from lightwood.mixer.base import BaseMixer
  from lightwood.ensemble.base import BaseEnsemble
  from lightwood.api.types import PredictionArguments
  from lightwood.data.encoded_ds import EncodedDs
  from type_infer.dtype import dtype
  from mindsdb_evaluator import evaluate_accuracies
  from type_infer.helpers import is_nan_numeric
  from lightwood.helpers.log import log
label_desc: Use image node_id 1 to create a new ModeEnsemble object from inherited base classes: BaseEnsemble with example: obj = ModeEnsemble(target, mixers, data, dtype_dict, accuracy_functions, args, ts_analysis, fit)