class_docstr: A class to pre-process targets.
  
  It validates the data provided during fit to make sure it matches Sklearn
  expectation as well as encoding the targets in case of classification
  
  Attributes
  ----------
  is_classification: bool
      A bool that indicates if the validator should operate in classification mode.
      During classification, the targets are encoded.
  
  encoder: Optional[BaseEstimator]
      Host a encoder object if the data requires transformation (for example, if
      provided a categorical column in a pandas DataFrame).
  
  enc_columns: List[str]
      List of columns that where encoded
class_docstr_tok: ["A","class","to","pre-process","targets",".","It","validates","the","data","provided","during","fit","to","make","sure","it","matches","Sklearn","expectation","as","well","as","encoding","the","targets","in","case","of","classification","Attributes","--","--","--","--","--","is_classification",":","bool","A","bool","that","indicates","if","the","validator","should","operate","in","classification","mode",".","During","classification",",","the","targets","are","encoded",".","encoder",":","Optional","[","BaseEstimator","]","Host","a","encoder","object","if","the","data","requires","transformation","(","for","example",",","if","provided","a","categorical","column","in","a","pandas","DataFrame",")",".","enc_columns",":","List","[","str","]","List","of","columns","that","where","encoded"]
docstr: Perform dimensionality and data type checks on the targets
  
  Parameters
  ----------
  y: Union[np.ndarray, pd.DataFrame, pd.Series]
      A set of features whose dimensionality and data type is going to be checked
docstr_tok: ["Perform","dimensionality","and","data","type","checks","on","the","targets","Parameters","--","--","--","--","--","y",":","Union","[","np.ndarray",",","pd.DataFrame",",","pd.Series","]","A","set","of","features","whose","dimensionality","and","data","type","is","going","to","be","checked"]
code: def _check_data(
      self,
      y: SUPPORTED_TARGET_TYPES,
  ) -> None:
      """
      Perform dimensionality and data type checks on the targets
  
      Parameters
      ----------
      y: Union[np.ndarray, pd.DataFrame, pd.Series]
          A set of features whose dimensionality and data type is going to be checked
      """
      if not isinstance(
          y, (np.ndarray, pd.DataFrame, List, pd.Series)
      ) and not isinstance(y, spmatrix):
          raise ValueError(
              "Auto-sklearn only supports Numpy arrays, Pandas DataFrames,"
              " pd.Series, sparse data and Python Lists as targets, yet, "
              "the provided input is of type {}".format(type(y))
          )
  
      if isinstance(y, spmatrix) and not np.issubdtype(
          y.dtype.type, np.number
      ):
          raise ValueError(
              "When providing a sparse matrix as targets, the only supported "
              "values are numerical. Please consider using a dense"
              " instead."
          )
  
      if self.data_type is None:
          self.data_type = type(y)
      if self.data_type != type(y):
          self.logger.warning(
              "Auto-sklearn previously received targets of type %s "
              "yet the current features have type %s. Changing the dtype "
              "of inputs to an estimator might cause problems"
              % (
                  str(self.data_type),
                  str(type(y)),
              ),
          )
  
      # No Nan is supported
      has_nan_values = False
      if hasattr(y, "iloc"):
          has_nan_values = cast(pd.DataFrame, y).isnull().values.any()
  
      if isinstance(y, spmatrix):
          has_nan_values = not np.array_equal(y.data, y.data)
      else:
          # List and array like values are considered here
          # np.isnan cannot work on strings, so we have to check for every element
          # but NaN, are not equal to themselves:
          has_nan_values = not np.array_equal(y, y)
      if has_nan_values:
          raise ValueError(
              "Target values cannot contain missing/NaN values. "
              "This is not supported by scikit-learn. "
          )
  
      # Pandas Series is not supported for multi-label indicator
      # This format checks are done by type of target
      try:
          self.type_of_target = type_of_target(y)
      except Exception as e:
          raise ValueError(
              "The provided data could not be interpreted by Sklearn. "
              "While determining the type of the targets via type_of_target "
              "run into exception: {}.".format(e)
          )
  
      supported_output_types = (
          "binary",
          "continuous",
          "continuous-multioutput",
          "multiclass",
          "multilabel-indicator",
          # Notice unknown/multiclass-multioutput are not supported
          # This can only happen during testing only as estimators
          # should filter out unsupported types.
      )
      if self.type_of_target not in supported_output_types:
          raise ValueError(
              "Provided targets are not supported by Auto-Sklearn. "
              "Provided type is {} whereas supported types are {}.".format(
                  self.type_of_target, supported_output_types
              )
          )
  
imports: from typing import List, Optional, Type, Union, cast
  import logging
  import warnings
  import numpy
  import pandas
  import sklearn.utils
  from pandas.api.types import is_numeric_dtype
  from pandas.core.dtypes.base import ExtensionDtype
  from scipy.sparse import spmatrix
  from sklearn.base import BaseEstimator
  from sklearn.exceptions import NotFittedError
  from sklearn.preprocessing import OrdinalEncoder
  from sklearn.utils.multiclass import type_of_target
  from autosklearn.util.logging_ import PickableLoggerAdapter
label_desc: Use image node_id 7 for calling the TargetValidator obj's underlying member method code with example usage: obj._check_data(y) without return types