code: def fit_dataset(
      train_data,
      init_args,
      fit_args,
      sample_size=None,
      scikit_api=False,
  ) -> TabularPredictor:
      if sample_size is not None and sample_size < len(train_data):
          train_data = train_data.sample(n=sample_size, random_state=0)
      if scikit_api:
          from autogluon.tabular.experimental import (
              TabularClassifier,
              TabularRegressor,
          )
  
          if "problem_type" in init_args:
              problem_type = init_args["problem_type"]
          else:
              problem_type = infer_problem_type(
                  train_data[init_args["label"]]
              )
          X = train_data.drop(columns=[init_args["label"]])
          y = train_data[init_args["label"]]
          if problem_type in [REGRESSION]:
              regressor = TabularRegressor(
                  init_args=init_args, fit_args=fit_args
              )
              regressor.fit(X, y)
              return regressor.predictor_
          else:
              classifier = TabularClassifier(
                  init_args=init_args, fit_args=fit_args
              )
              classifier.fit(X, y)
              return classifier.predictor_
      else:
          return TabularPredictor(**init_args).fit(
              train_data, **fit_args
          )
  
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 3 for calling the FitHelper obj's underlying member method code with example usage: obj.fit_dataset(train_data, init_args, fit_args, sample_size, scikit_api) and returns: TabularPredictor, regressor, classifier