class_docstr: Infers variable types for the column: numeric vs category.
  
  This analysis depends on :func:`RawTypesAnalysis`.
  
  Parameters
  ----------
  numeric_as_categorical_threshold: int, default = 20
      if numeric column has less than this value, then the variable should be considered as categorical
  parent: Optional[AbstractAnalysis], default = None
      parent Analysis
  children: Optional[List[AbstractAnalysis]], default None
      wrapped analyses; these will receive sampled `args` during `fit` call
  
  Examples
  --------
  >>> import autogluon.eda.analysis as eda
  >>> import autogluon.eda.visualization as viz
  >>> import autogluon.eda.auto as auto
  >>> state = auto.analyze(
  >>>     train_data=..., label=..., return_state=True,
  >>>     anlz_facets=[
  >>>         eda.dataset.RawTypesAnalysis(),
  >>>         eda.dataset.VariableTypeAnalysis(),
  >>>     ],
  >>>     viz_facets=[
  >>>         viz.dataset.DatasetStatistics()
  >>>     ]
  >>> )
  
  See Also
  --------
  :py:class:`~autogluon.eda.analysis.dataset.RawTypesAnalysis`
  :py:class:`~autogluon.eda.visualization.dataset.DatasetStatistics`
class_docstr_tok: ["Infers","variable","types","for","the","column",":","numeric","vs","category",".","This","analysis","depends","on",":","func",":","`","RawTypesAnalysis","`",".","Parameters","--","--","--","--","--","numeric_as_categorical_threshold",":","int",",","default","=","20","if","numeric","column","has","less","than","this","value",",","then","the","variable","should","be","considered","as","categorical","parent",":","Optional","[","AbstractAnalysis","]",",","default","=","None","parent","Analysis","children",":","Optional","[","List","[","AbstractAnalysis","]","]",",","default","None","wrapped","analyses",";","these","will","receive","sampled","`","args","`","during","`","fit","`","call","Examples","--","--","--","--",">",">",">","import","autogluon.eda.analysis","as","eda",">",">",">","import","autogluon.eda.visualization","as","viz",">",">",">","import","autogluon.eda.auto","as","auto",">",">",">","state","=","auto.analyze","(",">",">",">","train_data=","...",",","label=","...",",","return_state=True",",",">",">",">","anlz_facets=","[",">",">",">","eda.dataset.RawTypesAnalysis","(",")",",",">",">",">","eda.dataset.VariableTypeAnalysis","(",")",",",">",">",">","]",",",">",">",">","viz_facets=","[",">",">",">","viz.dataset.DatasetStatistics","(",")",">",">",">","]",">",">",">",")","See","Also","--","--","--","--",":","py",":","class",":","`","~autogluon.eda.analysis.dataset.RawTypesAnalysis","`",":","py",":","class",":","`","~autogluon.eda.visualization.dataset.DatasetStatistics","`"]
code: def map_raw_type_to_feature_type(
      col: Optional[str],
      raw_type: str,
      df: pd.DataFrame,
      numeric_as_categorical_threshold: int = 20,
  ) -> Union[None, str]:
      if col is None:
          return None
      elif df[col].nunique() <= numeric_as_categorical_threshold:
          return "category"
      elif raw_type in [R_INT, R_FLOAT]:
          return "numeric"
      elif raw_type in [R_OBJECT, R_CATEGORY, R_BOOL]:
          return "category"
      else:
          return None
  
imports: from __future__ import annotations
  from typing import Any, Dict, List, Optional, Set, Union
  import numpy
  import pandas
  from autogluon.common.features.infer_types import get_type_group_map_special, get_type_map_raw
  from autogluon.common.features.types import R_BOOL, R_CATEGORY, R_FLOAT, R_INT, R_OBJECT
  from ..state import AnalysisState
  from .base import AbstractAnalysis
  from autogluon.core.constants import BINARY, MULTICLASS, PROBLEM_TYPES_CLASSIFICATION, PROBLEM_TYPES_REGRESSION, REGRESSION
  from autogluon.core.utils import generate_train_test_split_combined, infer_problem_type
label_desc: Use image node_id 4 for calling the VariableTypeAnalysis obj's underlying member method code with example usage: obj.map_raw_type_to_feature_type(col, raw_type, df, numeric_as_categorical_threshold) and returns: None, str, str, str, None