class_docstr: Checks the input data to Auto-Sklearn.
  
  It also determines what columns are categorical and which ones are numerical,
  so that the pre-processing pipeline can process this columns accordingly.
  
  Attributes
  ----------
  feat_type: Optional[List[str]] = None
      In case the dataset is not a pandas DataFrame:
          +   If provided, this list indicates which columns should be treated as
              categorical it is internally transformed into a dictionary that
              indicates a mapping from column index to categorical/numerical.
          +   If not provided, by default all columns are treated as numerical
  
      If the input dataset is of type pandas dataframe, this argument
      must be none, as the column type will be inferred from the pandas dtypes.
  
  data_type:
      Class name of the data type provided during fit.
class_docstr_tok: ["Checks","the","input","data","to","Auto-Sklearn",".","It","also","determines","what","columns","are","categorical","and","which","ones","are","numerical",",","so","that","the","pre-processing","pipeline","can","process","this","columns","accordingly",".","Attributes","--","--","--","--","--","feat_type",":","Optional","[","List","[","str","]","]","=","None","In","case","the","dataset","is","not","a","pandas","DataFrame",":","+","If","provided",",","this","list","indicates","which","columns","should","be","treated","as","categorical","it","is","internally","transformed","into","a","dictionary","that","indicates","a","mapping","from","column","index","to","categorical\/numerical",".","+","If","not","provided",",","by","default","all","columns","are","treated","as","numerical","If","the","input","dataset","is","of","type","pandas","dataframe",",","this","argument","must","be","none",",","as","the","column","type","will","be","inferred","from","the","pandas","dtypes",".","data_type",":","Class","name","of","the","data","type","provided","during","fit","."]
docstr: Feature dimensionality and data type checks
  
  Parameters
  ----------
  X: SUPPORTED_FEAT_TYPES
      A set of features that are going to be validated (type and dimensionality)
      and a encoder fitted in the case the data needs encoding
docstr_tok: ["Feature","dimensionality","and","data","type","checks","Parameters","--","--","--","--","--","X",":","SUPPORTED_FEAT_TYPES","A","set","of","features","that","are","going","to","be","validated","(","type","and","dimensionality",")","and","a","encoder","fitted","in","the","case","the","data","needs","encoding"]
code: def _check_data(
      self,
      X: SUPPORTED_FEAT_TYPES,
  ) -> None:
      """
      Feature dimensionality and data type checks
  
      Parameters
      ----------
      X: SUPPORTED_FEAT_TYPES
          A set of features that are going to be validated (type and dimensionality)
          and a encoder fitted in the case the data needs encoding
      """
      # We consider columns that are all nan in a pandas frame as category
      if hasattr(X, "columns"):
          for column in cast(pd.DataFrame, X).columns:
              if X[column].isna().all():
                  X[column] = X[column].astype("category")
  
      if not isinstance(
          X, (np.ndarray, pd.DataFrame)
      ) and not isinstance(X, spmatrix):
          raise ValueError(
              "Auto-sklearn only supports Numpy arrays, Pandas DataFrames,"
              " scipy sparse and Python Lists, yet, the provided input is"
              " of type {}".format(type(X))
          )
  
      if self.data_type is None:
          self.data_type = type(X)
  
      if self.data_type != type(X):
          self.logger.warning(
              f"Auto-sklearn previously received features of type {self.data_type} "
              f"yet the current features have type {type(X)}. Changing the dtype "
              "of inputs to an estimator might cause problems"
          )
  
      # Do not support category/string numpy data. Only numbers
      if hasattr(X, "dtype"):
          if not np.issubdtype(X.dtype.type, np.number):  # type: ignore[union-attr]
              raise ValueError(
                  "When providing a numpy array to Auto-sklearn, the only valid"
                  f" dtypes are numerical ones. The provided data type {X.dtype.type}"
                  " is not supported."
              )
  
      # Then for Pandas, we do not support Nan in categorical columns
      if hasattr(X, "iloc"):
          # If entered here, we have a pandas dataframe
          X = cast(pd.DataFrame, X)
  
          dtypes = {col: X[col].dtype.name.lower() for col in X.columns}
          if len(self.dtypes) > 0:
              if self.dtypes != dtypes:
                  # To support list, we need to support object inference.
                  # In extreme cases, the train column might be all integer,
                  # and the test column might be float.
                  self.logger.warning(
                      "Changing the dtype of the features after fit() is "
                      "not recommended. Fit() method was called with "
                      "{} whereas the new features have {} as type".format(
                          self.dtypes,
                          dtypes,
                      )
                  )
          else:
              self.dtypes = dtypes
  
file_path: auto-sklearn/autosklearn/data/feature_validator.py
imports: from typing import Dict, List, Optional, Tuple, Union, cast
  import logging
  import warnings
  import numpy
  import pandas
  from pandas.api.types import is_numeric_dtype, is_sparse
  from scipy.sparse import csr_matrix, spmatrix
  from sklearn.base import BaseEstimator
  from sklearn.exceptions import NotFittedError
  from autosklearn.util.logging_ import PickableLoggerAdapter
label_desc: Use image node_id 4 for calling the FeatureValidator obj's underlying member method code with example usage: obj._check_data(X) without return types