class_docstr: Meta-estimator to classify on a transformed target.
  
  Parameters
  ----------
  classifier : object, default=None
      Classifier object such as derived from ``ClassifierMixin``. This
      classifier will automatically be cloned each time prior to fitting.
  
  transformer : object, default=None
      Estimator object such as derived from ``TransformerMixin``. Note that the
      transformer will be cloned during fitting. Also, the transformer is
      restricting ``y`` to be a numpy array.
  
  check_inverse : bool, default=True
      Whether to check that ``transform`` followed by ``inverse_transform``
      leads to the original targets.
  
  Attributes
  ----------
  classifier_ : object
      Fitted classifier.
  
  transformer_ : object
      Transformer used in ``fit`` and ``predict``.
  
  Notes
  -----
  This is a modification from TransformedTargetRegressor.
  
  See :ref:`sklearn.compose.TransformedTargetRegressor
class_docstr_tok: ["Meta-estimator","to","classify","on","a","transformed","target",".","Parameters","--","--","--","--","--","classifier",":","object",",","default=None","Classifier","object","such","as","derived","from","``","ClassifierMixin","``",".","This","classifier","will","automatically","be","cloned","each","time","prior","to","fitting",".","transformer",":","object",",","default=None","Estimator","object","such","as","derived","from","``","TransformerMixin","``",".","Note","that","the","transformer","will","be","cloned","during","fitting",".","Also",",","the","transformer","is","restricting","``","y","``","to","be","a","numpy","array",".","check_inverse",":","bool",",","default=True","Whether","to","check","that","``","transform","``","followed","by","``","inverse_transform","``","leads","to","the","original","targets",".","Attributes","--","--","--","--","--","classifier_",":","object","Fitted","classifier",".","transformer_",":","object","Transformer","used","in","``","fit","``","and","``","predict","``",".","Notes","--","--","-","This","is","a","modification","from","TransformedTargetRegressor",".","See",":","ref",":","`","sklearn.compose.TransformedTargetRegressor"]
docstr: Check transformer and fit transformer.
  
  Create the default transformer, fit it and make additional inverse
  check on a subset (optional).
  
  Parameters
  ----------
  y : array-like of shape (n_samples,)
      Target values.
docstr_tok: ["Check","transformer","and","fit","transformer",".","Create","the","default","transformer",",","fit","it","and","make","additional","inverse","check","on","a","subset","(","optional",")",".","Parameters","--","--","--","--","--","y",":","array-like","of","shape","(","n_samples",",",")","Target","values","."]
code: def _fit_transformer(self, y):
      """Check transformer and fit transformer.
  
      Create the default transformer, fit it and make additional inverse
      check on a subset (optional).
  
      Parameters
      ----------
      y : array-like of shape (n_samples,)
          Target values.
      """
      if self.transformer is not None:
          self.transformer_ = clone(self.transformer)
      else:  # Just return the identity transformer
          self.transformer_ = LabelEncoder()
  
      self.transformer_.fit(y)
      if self.check_inverse:
          idx_selected = slice(None, None, max(1, y.shape[0] // 10))
          y_sel = _safe_indexing(y, idx_selected)
          y_sel_t = self.transformer_.transform(y_sel)
  
          if (
              np.ravel(y_sel)
              != self.transformer_.inverse_transform(y_sel_t)
          ).any():
              warnings.warn(
                  "The provided functions or transformer are"
                  " not strictly inverse of each other. If"
                  " you are sure you want to proceed regardless"
                  ", set 'check_inverse=False'",
                  UserWarning,
              )
  
file_path: pycaret/pycaret/internal/preprocess/target/TransformedTargetClassifier.py
imports: import warnings
  import numpy
  import pandas
  from sklearn.base import BaseEstimator, ClassifierMixin, clone
  from sklearn.exceptions import NotFittedError
  from sklearn.preprocessing import LabelEncoder
  from sklearn.utils import _safe_indexing
  from sklearn.utils.validation import _deprecate_positional_args, check_is_fitted, check_X_y
  from .utils import TargetTransformerMixin
label_desc: Use image node_id 2 for calling the TransformedTargetClassifier obj's underlying member method code with example usage: obj._fit_transformer(y) without return types