code: def quick_fit(
      train_data: pd.DataFrame,
      label: str,
      test_data: Optional[pd.DataFrame] = None,
      path: Optional[str] = None,
      val_size: float = 0.3,
      problem_type: str = "auto",
      fit_bagging_folds: int = 0,
      sample: Union[None, int, float] = DEFAULT_SAMPLE_SIZE,
      state: Union[None, dict, AnalysisState] = None,
      return_state: bool = False,
      save_model_to_state: bool = True,
      verbosity: int = 0,
      show_feature_importance_barplots: bool = False,
      estimator_args: Optional[Dict[str, Dict[str, Any]]] = None,
      fig_args: Optional[Dict[str, Dict[str, Any]]] = None,
      chart_args: Optional[Dict[str, Dict[str, Any]]] = None,
      render_analysis: bool = True,
      **fit_args,
  ):
      """
      This helper performs quick model fit analysis and then produces a composite report of the results.
  
      The analysis is structured in a sequence of operations:
          - Sample if `sample` is specified.
          - Perform train-test split using `val_size` ratio
          - Fit AutoGluon estimator given `fit_args`; if `hyperparameters` not present in args, then use default ones
              (Random Forest by default - because it is interpretable)
          - Display report
  
      The reports include:
          - confusion matrix for classification problems; predictions vs actual for regression problems
          - model leaderboard
          - feature importance
          - samples with the highest prediction error - candidates for inspection
          - samples with the least distance from the other class - candidates for labeling
  
      Supported `fig_args`/`chart_args` keys:
          - `confusion_matrix.<property>` - confusion matrix chart for classification predictor
          - `regression_eval.<property>` - regression predictor results chart
          - `feature_importance.<property>` - feature importance barplot chart
  
      State attributes
  
      - `model`
          trained model
      - `model_evaluation.importance`
          feature importance calculated using the trained model
      - `model_evaluation.leaderboard`
          trained models leaderboard
      - `model_evaluation.highest_error`
          misclassified rows with the highest error between prediction and ground truth
      - `model_evaluation.undecided` (classification only)
          misclassified rows with the prediction closest to the decision boundary
      - `model_evaluation.confusion_matrix` (classification only)
          confusion matrix values
  
      Parameters
      ----------
      train_data: DataFrame
          training dataset
      test_data: DataFrame
          test dataset
      label: str
          target variable
      path: Optional[str], default = None,
          path for models saving
      problem_type: str, default = 'auto'
          problem type to use. Valid problem_type values include ['auto', 'binary', 'multiclass', 'regression', 'quantile', 'softclass']
          auto means it will be Auto-detected using AutoGluon methods.
      fit_bagging_folds: int, default = 0,
          shortcut to enable training with bagged folds; disabled if 0 (default)
      sample: Union[None, int, float], default = 10000
          sample size; if `int`, then row number is used;
          `float` must be between 0.0 and 1.0 and represents fraction of dataset to sample;
          `None` means no sampling
          See also :func:`autogluon.eda.analysis.dataset.Sampler`
      val_size: float, default = 0.3
          fraction of training set to be assigned as validation set during the split.
      state: Union[None, dict, AnalysisState], default = None
          pass prior state if necessary; the object will be updated during `anlz_facets` `fit` call.
      return_state: bool, default = False
          return state if `True`
      save_model_to_state: bool, default = True,
          save fitted model into `state` under `model` key.
          This functionality might be helpful in cases when the fitted model could be usable for other purposes (i.e. imputers)
      verbosity: int, default = 0
          Verbosity levels range from 0 to 4 and control how much information is printed.
          Higher levels correspond to more detailed print statements (you can set verbosity = 0 to suppress warnings).
          If using logging, you can alternatively control amount of information printed via `logger.setLevel(L)`,
          where `L` ranges from 0 to 50 (Note: higher values of `L` correspond to fewer print statements, opposite of verbosity levels).
      show_feature_importance_barplots: bool, default = False
          if `True`, then barplot char will ba added with feature importance visualization
      estimator_args: Optional[Dict[str, Dict[str, Any]]], default = None,
          args to pass into the estimator constructor
      fit_args: Optional[Dict[str, Dict[str, Any]]], default = None,
          kwargs to pass into `TabularPredictor` fit.
      fig_args: Optional[Dict[str, Any]], default = None,
          figures args for visualizations; key == component; value = dict of kwargs for component figure. The args are supporting nested
          dot syntax: 'a.b.c'.
      chart_args: Optional[Dict[str, Any]], default = None,
          figures args for visualizations; key == component; value = dict of kwargs for component chart. The args are supporting nested
          dot syntax: 'a.b.c'.
      render_analysis: bool, default = True
          if `False`, then don't render any visualizations; this can be used if user just needs to train a model. It is recommended to use this option
          with `save_model_to_state=True` and `return_state=True` options.
  
      Returns
      -------
          state after `fit` call if `return_state` is `True`; `None` otherwise
  
      Examples
      --------
      >>> import autogluon.eda.analysis as eda
      >>> import autogluon.eda.auto as auto
      >>>
      >>> # Quick fit
      >>> state = auto.quick_fit(
      >>>     train_data=..., label=...,
      >>>     return_state=True,  # return state object from call
      >>>     fig_args={"regression_eval.figsize": (8,6)},  # customize regression evaluation `figsize`
      >>>     chart_args={"regression_eval.residuals_plot_mode": "hist"}  # customize regression evaluation `residuals_plot_mode`
      >>>     hyperparameters={'GBM': {}}  # train specific model
      >>> )
      >>>
      >>> # Using quick fit model
      >>> model = state.model
      >>> y_pred = model.predict(test_data)
  
      See Also
      --------
      :py:class:`~autogluon.eda.visualization.model.ConfusionMatrix`
      :py:class:`~autogluon.eda.visualization.model.RegressionEvaluation`
      :py:class:`~autogluon.eda.visualization.model.ModelLeaderboard`
      :py:class:`~autogluon.eda.visualization.model.FeatureImportance`
  
      """
      if state is not None:
          assert isinstance(state, (dict, AnalysisState))
  
      if not isinstance(state, AnalysisState):
          state = AnalysisState(state)
  
      fig_args = expand_nested_args_into_nested_maps(
          get_empty_dict_if_none(fig_args)
      )
      chart_args = expand_nested_args_into_nested_maps(
          get_empty_dict_if_none(chart_args)
      )
  
      estimator_args = get_empty_dict_if_none(estimator_args)
      assert (
          fit_bagging_folds >= 0
      ), "fit_bagging_folds must be non-negative"
      fit_args = get_default_estimator_if_not_specified(
          fit_args, fit_bagging_folds
      )
  
      if "path" not in estimator_args:
          estimator_args["path"] = path  # type: ignore
  
      if (test_data is not None) and (label not in test_data.columns):
          test_data = None
  
      if render_analysis:
          viz = [
              MarkdownSectionComponent(
                  markdown=f"### Model Prediction for {label}"
              ),
              MarkdownSectionComponent(
                  condition_fn=(
                      lambda state: is_key_present_in_state(
                          state, "model_evaluation.y_pred_test"
                      )
                  ),
                  markdown="Using `test_data` for `Test` points",
              ),
              MarkdownSectionComponent(
                  condition_fn=(
                      lambda state: not is_key_present_in_state(
                          state, "model_evaluation.y_pred_test"
                      )
                  ),
                  markdown="Using validation data for `Test` points",
              ),
              ConfusionMatrix(
                  fig_args=fig_args.get("confusion_matrix", {}),
                  **chart_args.get(
                      "confusion_matrix", dict(annot_kws={"size": 12})
                  ),
              ),
              RegressionEvaluation(
                  fig_args=fig_args.get("regression_eval", {}),
                  **chart_args.get("regression_eval", {}),
              ),
              MarkdownSectionComponent(
                  markdown="### Model Leaderboard"
              ),
              ModelLeaderboard(),
              MarkdownSectionComponent(
                  markdown="### Feature Importance for Trained Model"
              ),
              FeatureImportance(
                  show_barplots=show_feature_importance_barplots,
                  fig_args=fig_args.get("feature_importance", {}),
                  **chart_args.get("feature_importance", {}),
              ),
              MarkdownSectionComponent(
                  markdown="### Rows with the highest prediction error"
              ),
              MarkdownSectionComponent(
                  markdown="Rows in this category worth inspecting for the causes of the error"
              ),
              PropertyRendererComponent(
                  "model_evaluation.highest_error",
                  transform_fn=(lambda df: df.head(10)),
              ),
              MarkdownSectionComponent(
                  condition_fn=(
                      lambda state: is_key_present_in_state(
                          state, "model_evaluation.undecided"
                      )
                  ),
                  markdown="### Rows with the least distance vs other class",
              ),
              MarkdownSectionComponent(
                  condition_fn=(
                      lambda state: is_key_present_in_state(
                          state, "model_evaluation.undecided"
                      )
                  ),
                  markdown="Rows in this category are the closest to the decision boundary vs the other class "
                  "and are good candidates for additional labeling",
              ),
              PropertyRendererComponent(
                  "model_evaluation.undecided",
                  transform_fn=(lambda df: df.head(10)),
              ),
          ]
      else:
          viz = []
  
      return analyze(
          train_data=train_data,
          test_data=test_data,
          label=label,
          sample=sample,
          state=state,
          return_state=return_state,
          anlz_facets=[
              ProblemTypeControl(problem_type=problem_type),
              TrainValidationSplit(
                  val_size=val_size,
                  children=[
                      AutoGluonModelQuickFit(
                          estimator_args=estimator_args,
                          verbosity=verbosity,
                          problem_type=problem_type,
                          save_model_to_state=save_model_to_state,
                          children=[
                              AutoGluonModelEvaluator(),
                          ],
                          **fit_args,
                      ),
                  ],
              ),
          ],
          viz_facets=viz,
      )
  
imports: import logging
  from typing import Any, Dict, List, Optional, Tuple, Union
  import pandas
  from autogluon.common.utils.log_utils import verbosity2loglevel
  from autogluon.features import CategoryFeatureGenerator
  from autogluon.tabular import TabularPredictor
  from ..None import AnalysisState
  from ..analysis import AnomalyDetectorAnalysis, ApplyFeatureGenerator, AutoGluonModelEvaluator, AutoGluonModelQuickFit, Correlation, DistributionFit, FeatureInteraction, MissingValuesAnalysis, ProblemTypeControl, ShapAnalysis, TrainValidationSplit, XShiftDetector
  from ..analysis.base import AbstractAnalysis, BaseAnalysis, SaveArgsToState
  from ..analysis.dataset import DatasetSummary, LabelInsightsAnalysis, RawTypesAnalysis, Sampler, SpecialTypesAnalysis, VariableTypeAnalysis
  from ..analysis.interaction import FeatureDistanceAnalysis
  from ..state import is_key_present_in_state
  from ..utils.common import expand_nested_args_into_nested_maps, get_empty_dict_if_none
  from ..utils.defaults import QuickFitDefaults
  from ..visualization import AnomalyScoresVisualization, ConfusionMatrix, CorrelationVisualization, DatasetStatistics, DatasetTypeMismatch, ExplainForcePlot, ExplainWaterfallPlot, FeatureImportance, FeatureInteractionVisualization, LabelInsightsVisualization, MarkdownSectionComponent, MissingValues, ModelLeaderboard, PropertyRendererComponent, RegressionEvaluation, XShiftSummary
  from ..visualization.base import AbstractVisualization
  from ..visualization.interaction import FeatureDistanceAnalysisVisualization, PDPInteractions
  from ..visualization.layouts import SimpleVerticalLinearLayout
label_desc: Use image node_id 4 for calling a global function with example usage: quick_fit(train_data, label, test_data, path, val_size, problem_type, fit_bagging_folds, sample, state, return_state, save_model_to_state, verbosity, show_feature_importance_barplots, estimator_args, fig_args, chart_args, render_analysis) and returns: analyze