def METHOD_NAME(dataset, config):
    log.info(f"\n**** AutoGluon [v{__version__}] ****\n")
    metrics_mapping = dict(
        acc=metrics.accuracy,
        auc=metrics.roc_auc,
        f1=metrics.f1,
        logloss=metrics.log_loss,
        mae=metrics.mean_absolute_error,
        mse=metrics.mean_squared_error,
        r2=metrics.r2,
        rmse=metrics.root_mean_squared_error,
    )
    perf_metric = metrics_mapping[config.metric] if config.metric in metrics_mapping else None
    if perf_metric is None:
        # TODO: figure out if we are going to blindly pass metrics through, or if we use a strict mapping
        log.warning("Performance metric %s not supported.", config.metric)
    is_classification = config.type == 'classification'
    training_params = {k: v for k, v in config.framework_params.items() if not k.startswith('_')}
    presets = training_params.get("presets", [])
    presets = presets if isinstance(presets, list) else [presets]
    if preset_with_refit_full := (set(presets) & {"good_quality", "high_quality"}):
        preserve = 0.9
        preset = next(iter(preset_with_refit_full))
        msg = (
            f"Detected `{preset}` preset, reducing `max_runtime_seconds` "
            f"from {config.max_runtime_seconds}s to "
            f"{preserve * config.max_runtime_seconds}s to account for `refit_full` "
            f"call after fit, which can take up to ~15% of total time. "
            "See https://auto.gluon.ai/stable/api/autogluon.tabular.TabularPredictor.refit_full.html"
        )
        log.info(msg)
        config.max_runtime_seconds = preserve * config.max_runtime_seconds
    train_path, test_path = dataset.train.path, dataset.test.path
    label = dataset.target.name
    problem_type = dataset.problem_type
    models_dir = tempfile.mkdtemp() + os.sep  # passed to AG
    with Timer() as training:
        predictor = TabularPredictor(
            label=label,
            eval_metric=perf_metric.name,
            path=models_dir,
            problem_type=problem_type,
        ).fit(
            train_data=train_path,
            time_limit=config.max_runtime_seconds,
            **training_params
        )
    log.info(f"Finished fit in {training.duration}s.")
    # Persist model in memory that is going to be predicting to get correct inference latency
    # max_memory=0.4 will be future default: https://github.com/autogluon/autogluon/pull/3338
    predictor.persist_models('best', max_memory=0.4)
    def inference_time_classification(data: Union[str, pd.DataFrame]):
        return None, predictor.predict_proba(data, as_multiclass=True)
    def inference_time_regression(data: Union[str, pd.DataFrame]):
        return predictor.predict(data, as_pandas=False), None
    infer = inference_time_classification if is_classification else inference_time_regression
    inference_times = {}
    if config.measure_inference_time:
        inference_times["file"] = measure_inference_times(infer, dataset.inference_subsample_files)
        test_data = pd.read_parquet(dataset.test.path)
        inference_times["df"] = measure_inference_times(
            infer,
            [(1, test_data.sample(1, random_state=i)) for i in range(100)],
        )
        log.info(f"Finished inference time measurements.")
    test_data = TabularDataset(test_path)
    with Timer() as predict:
        predictions, probabilities = infer(test_data)
    if is_classification:
        predictions = probabilities.idxmax(axis=1).to_numpy()
    prob_labels = probabilities.columns.values.astype(str).tolist() if probabilities is not None else None
    log.info(f"Finished predict in {predict.duration}s.")
    _leaderboard_extra_info = config.framework_params.get('_leaderboard_extra_info', False)  # whether to get extra model info (very verbose)
    _leaderboard_test = config.framework_params.get('_leaderboard_test', False)  # whether to compute test scores in leaderboard (expensive)
    leaderboard_kwargs = dict(silent=True, extra_info=_leaderboard_extra_info)
    # Disabled leaderboard test data input by default to avoid long running computation, remove 7200s timeout limitation to re-enable
    if _leaderboard_test:
        leaderboard_kwargs['data'] = test_data
    leaderboard = predictor.leaderboard(**leaderboard_kwargs)
    with pd.option_context('display.max_rows', None, 'display.max_columns', None, 'display.width', 1000):
        log.info(leaderboard)
    num_models_trained = len(leaderboard)
    if predictor._trainer.model_best is not None:
        num_models_ensemble = len(predictor._trainer.get_minimum_model_set(predictor._trainer.model_best))
    else:
        num_models_ensemble = 1
    save_artifacts(predictor, leaderboard, config)
    shutil.rmtree(predictor.path, ignore_errors=True)
    return result(output_file=config.output_predictions_file,
                  predictions=predictions,
                  probabilities=probabilities,
                  probabilities_labels=prob_labels,
                  target_is_encoded=False,
                  models_count=num_models_trained,
                  models_ensemble_count=num_models_ensemble,
                  training_duration=training.duration,
                  predict_duration=predict.duration,
                  inference_times=inference_times,)