docstr: The internal fit function
  
  Parameters
  ----------
  X
      Features of the training dataset
  y
      Labels of the training dataset
  X_val
      Features of the validation dataset
  y_val
      Labels of the validation dataset
  time_limit
      The time limits for the fit function
  sample_weight
      The weights of the samples
  kwargs
      Other keyword arguments
docstr_tok: ["The","internal","fit","function","Parameters","--","--","--","--","--","X","Features","of","the","training","dataset","y","Labels","of","the","training","dataset","X_val","Features","of","the","validation","dataset","y_val","Labels","of","the","validation","dataset","time_limit","The","time","limits","for","the","fit","function","sample_weight","The","weights","of","the","samples","kwargs","Other","keyword","arguments"]
code: def _fit(
      self,
      X: pd.DataFrame,
      y: pd.Series,
      X_val: Optional[pd.DataFrame] = None,
      y_val: Optional[pd.Series] = None,
      time_limit: Optional[int] = None,
      sample_weight=None,
      **kwargs,
  ):
      """The internal fit function
  
      Parameters
      ----------
      X
          Features of the training dataset
      y
          Labels of the training dataset
      X_val
          Features of the validation dataset
      y_val
          Labels of the validation dataset
      time_limit
          The time limits for the fit function
      sample_weight
          The weights of the samples
      kwargs
          Other keyword arguments
  
      """
      try_import_autogluon_multimodal()
      from autogluon.multimodal import MultiModalPredictor
  
      # Decide name of the label column
      if "label" in X.columns:
          label_col_id = 0
          while True:
              self._label_column_name = "label{}".format(label_col_id)
              if self._label_column_name not in X.columns:
                  break
              label_col_id += 1
      else:
          self._label_column_name = "label"
  
      X, y, X_val, y_val = self.preprocess_fit(
          X=X, y=y, X_val=X_val, y_val=y_val
      )
      params = self._get_model_params()
      max_features = params.pop(
          "_max_features", None
      )  # FIXME: `_max_features` is a hack. Instead use ag_args_fit and make generic
      num_features = len(X.columns)
      if max_features is not None and num_features > max_features:
          raise AssertionError(
              f"Feature count ({num_features}) is greater than max allowed features ({max_features}) for {self.name}. Skipping model... "
              f"To increase the max allowed features, specify the value via the `_max_features` parameter "
              f"(Fully ignore by specifying `None`. "
              f"`_max_features` is experimental and will likely change API without warning in future releases."
          )
  
      # Get arguments from kwargs
      verbosity = kwargs.get("verbosity", 2)
      if verbosity <= 2:
          enable_progress_bar = False
      else:
          enable_progress_bar = True
      num_gpus = kwargs.get("num_gpus", None)
      if sample_weight is not None:  # TODO: support
          logger.log(
              15,
              "sample_weight not yet supported for MultiModalPredictorModel, "
              "this model will ignore them in training.",
          )
  
      # Need to deep copy to avoid altering outer context
      X = X.copy()
      X.insert(len(X.columns), self._label_column_name, y)
      if X_val is not None:
          X_val = X_val.copy()
          X_val.insert(
              len(X_val.columns), self._label_column_name, y_val
          )
  
      column_types = self._construct_column_types()
  
      verbosity_text = max(0, verbosity - 1)
      root_logger = logging.getLogger("autogluon")
      root_log_level = root_logger.level
      # in self.save(), the model is saved to automm_nn_path
      automm_nn_path = os.path.join(self.path, self._NN_MODEL_NAME)
      self.model = MultiModalPredictor(
          label=self._label_column_name,
          problem_type=self.problem_type,
          path=automm_nn_path,
          eval_metric=self.eval_metric,
          verbosity=verbosity_text,
          enable_progress_bar=enable_progress_bar,
      )
  
      if num_gpus is not None:
          params["env.num_gpus"] = num_gpus
      presets = params.pop("presets", None)
      seed = params.pop("seed", 0)
  
      self.model.fit(
          train_data=X,
          tuning_data=X_val,
          time_limit=time_limit,
          presets=presets,
          hyperparameters=params,
          column_types=column_types,
          seed=seed,
      )
  
      self.model.set_verbosity(verbosity)
      root_logger.setLevel(root_log_level)
  
imports: import logging
  import os
  from typing import Dict, Optional
  import pandas
  from autogluon.common.features.types import R_CATEGORY, R_FLOAT, R_INT, R_OBJECT, S_IMAGE_PATH, S_TEXT, S_TEXT_AS_CATEGORY, S_TEXT_NGRAM, S_TEXT_SPECIAL
  from autogluon.common.utils.resource_utils import ResourceManager
  from autogluon.common.utils.try_import import try_import_autogluon_multimodal
  from autogluon.core.constants import BINARY, MULTICLASS, REGRESSION
  from autogluon.core.models import AbstractModel
label_desc: Use image node_id 7 for calling the MultiModalPredictorModel obj's underlying member method code with example usage: obj._fit(X, y, X_val, y_val, time_limit, sample_weight) without return types