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: Converts a list to a DataFrame. In this process, column types are inferred.
  
  If test data is provided, we proactively match it to train data
  
  Parameters
  ----------
  X_train: SUPPORTED_FEAT_TYPES
      A set of features that are going to be validated (type and dimensionality
      checks) and a encoder fitted in the case the data needs encoding
  
  X_test: Optional[SUPPORTED_FEAT_TYPES]
      A hold out set of data used for checking
  
  Returns
  -------
  Union[pd.DataFrame, pd.DataFrame]:
      transformed (train, test) data from list to pandas DataFrame
docstr_tok: ["Converts","a","list","to","a","DataFrame",".","In","this","process",",","column","types","are","inferred",".","If","test","data","is","provided",",","we","proactively","match","it","to","train","data","Parameters","--","--","--","--","--","X_train",":","SUPPORTED_FEAT_TYPES","A","set","of","features","that","are","going","to","be","validated","(","type","and","dimensionality","checks",")","and","a","encoder","fitted","in","the","case","the","data","needs","encoding","X_test",":","Optional","[","SUPPORTED_FEAT_TYPES","]","A","hold","out","set","of","data","used","for","checking","Returns","--","--","--","-","Union","[","pd.DataFrame",",","pd.DataFrame","]",":","transformed","(","train",",","test",")","data","from","list","to","pandas","DataFrame"]
code: def list_to_dataframe(
      self,
      X_train: SUPPORTED_FEAT_TYPES,
      X_test: Optional[SUPPORTED_FEAT_TYPES] = None,
  ) -> Tuple[pd.DataFrame, Optional[pd.DataFrame]]:
      """
      Converts a list to a DataFrame. In this process, column types are inferred.
  
      If test data is provided, we proactively match it to train data
  
      Parameters
      ----------
      X_train: SUPPORTED_FEAT_TYPES
          A set of features that are going to be validated (type and dimensionality
          checks) and a encoder fitted in the case the data needs encoding
  
      X_test: Optional[SUPPORTED_FEAT_TYPES]
          A hold out set of data used for checking
  
      Returns
      -------
      Union[pd.DataFrame, pd.DataFrame]:
          transformed (train, test) data from list to pandas DataFrame
      """
      # If a list was provided, it will be converted to pandas
      X_train = pd.DataFrame(data=X_train).convert_dtypes()
  
      # Store the dtypes and use in case of re-fit
      if len(self.dtypes) == 0:
          self.dtypes = {
              col: X_train[col].dtype.name.lower()
              for col in X_train.columns
          }
      else:
          for col in X_train.columns:
              # Try to convert to the original dtype used to fit the validator
              # But also be robust to extreme cases (for example, the train data for a
              # column was all np.int-like and the test data is np.float-type)
              try:
                  X_train[col] = X_train[col].astype(self.dtypes[col])
              except Exception as e:
                  self.logger.warning(
                      f"Failed to format column {col} as {self.dtypes[col]}: {e}"
                  )
                  self.dtypes[col] = X_train[col].dtype.name.lower()
  
      self.logger.warning(
          "The provided feature types to autosklearn are of type list."
          "Features have been interpreted as: {}".format(
              [
                  (col, t)
                  for col, t in zip(X_train.columns, X_train.dtypes)
              ]
          )
      )
      if X_test is not None:
          if not isinstance(X_test, List):
              self.logger.warning(
                  "Train features are a list while the provided test data"
                  "is {}. X_test will be casted as DataFrame.".format(
                      type(X_test)
                  )
              )
          X_test = pd.DataFrame(data=X_test)
          for col in X_test.columns:
              try:
                  X_test[col] = X_test[col].astype(self.dtypes[col])
              except Exception as e:
                  self.logger.warning(
                      f"Failed to format column {col} as {self.dtypes[col]}: {e}"
                  )
                  self.dtypes[col] = X_test[col].dtype.name.lower()
  
      return X_train, X_test
  
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 6 for calling the FeatureValidator obj's underlying member method code with example usage: obj.list_to_dataframe(X_train, X_test) and returns: X_train,  X_test