code: def fit_dataset(
      train_data: pd.DataFrame,
      model: AbstractModel,
      label: str,
      fit_args: dict,
      sample_size: int = None,
  ) -> Tuple[AbstractModel, LabelCleaner, AbstractFeatureGenerator]:
      if sample_size is not None and sample_size < len(train_data):
          train_data = train_data.sample(n=sample_size, random_state=0)
      X = train_data.drop(columns=[label])
      y = train_data[label]
  
      problem_type = infer_problem_type(y)
      label_cleaner = LabelCleaner.construct(
          problem_type=problem_type, y=y
      )
      y = label_cleaner.transform(y)
      feature_generator = AutoMLPipelineFeatureGenerator()
      X = feature_generator.fit_transform(X, y)
  
      X, X_val, y, y_val = generate_train_test_split(
          X, y, problem_type=problem_type, test_size=0.2, random_state=0
      )
  
      model.fit(X=X, y=y, X_val=X_val, y_val=y_val, **fit_args)
      return model, label_cleaner, feature_generator
  
imports: import copy
  import os
  import shutil
  import uuid
  from contextlib import contextmanager
  from typing import List, Tuple
  import numpy
  import pandas
  import pytest
  from autogluon.common.utils.path_converter import PathConverter
  from autogluon.common.utils.resource_utils import ResourceManager
  from autogluon.core.constants import BINARY, MULTICLASS, REGRESSION
  from autogluon.core.data.label_cleaner import LabelCleaner
  from autogluon.core.models import AbstractModel, BaggedEnsembleModel
  from autogluon.core.stacked_overfitting.utils import check_stacked_overfitting_from_leaderboard
  from autogluon.core.utils import download, generate_train_test_split, infer_problem_type, unzip
  from autogluon.features.generators import AbstractFeatureGenerator, AutoMLPipelineFeatureGenerator
  from autogluon.tabular import TabularDataset, TabularPredictor
label_desc: Use image node_id 2 for calling the ModelFitHelper obj's underlying member method code with example usage: obj.fit_dataset(train_data, model, label, fit_args, sample_size) and returns: model,  label_cleaner,  feature_generator