docstr: Fit estimator.
  
  Requires to either specify the target as separate 1d array or Series y
  (in scikit-learn fashion) or as column of the dataframe X specified by
  target_col.
  If y is specified, X is assumed not to contain the target.
  
  Parameters
  ----------
  X : DataFrame
      Input features. If target_col is specified, X also includes the
      target.
  y : Series or numpy array, optional.
      Target. You need to specify either y or target_col.
  target_col : string or int, optional
      Column name of target if included in X.
docstr_tok: ["Fit","estimator",".","Requires","to","either","specify","the","target","as","separate","1d","array","or","Series","y","(","in","scikit-learn","fashion",")","or","as","column","of","the","dataframe","X","specified","by","target_col",".","If","y","is","specified",",","X","is","assumed","not","to","contain","the","target",".","Parameters","--","--","--","--","--","X",":","DataFrame","Input","features",".","If","target_col","is","specified",",","X","also","includes","the","target",".","y",":","Series","or","numpy","array",",","optional",".","Target",".","You","need","to","specify","either","y","or","target_col",".","target_col",":","string","or","int",",","optional","Column","name","of","target","if","included","in","X","."]
code: def _fit(self, X, y=None, target_col=None):
      """Fit estimator.
  
      Requires to either specify the target as separate 1d array or Series y
      (in scikit-learn fashion) or as column of the dataframe X specified by
      target_col.
      If y is specified, X is assumed not to contain the target.
  
      Parameters
      ----------
      X : DataFrame
          Input features. If target_col is specified, X also includes the
          target.
      y : Series or numpy array, optional.
          Target. You need to specify either y or target_col.
      target_col : string or int, optional
          Column name of target if included in X.
      """
      X, y = _validate_Xyt(X, y, target_col, do_clean=False)
      if not isinstance(X, pd.DataFrame):
          X = pd.DataFrame(X)
      types = detect_types(X, type_hints=self.type_hints)
      self.feature_names_ = X.columns
      self.types_ = types
  
      y, self.scoring_ = self._preprocess_target(y)
      self.log_ = []
  
      # reimplement cross-validation so we only do preprocessing once
      # This could/should be solved with dask?
      if isinstance(self, RegressorMixin):
          # this is how inheritance works, right?
          cv = KFold(
              n_splits=5,
              shuffle=self.shuffle,
              random_state=self.random_state,
          )
      elif isinstance(self, ClassifierMixin):
          cv = StratifiedKFold(
              n_splits=5,
              shuffle=self.shuffle,
              random_state=self.random_state,
          )
      data_preproc = []
      for i, (train, test) in enumerate(cv.split(X, y)):
          # maybe do two levels of preprocessing
          # to search over treatment of categorical variables etc
          # Also filter?
          verbose = self.verbose if i == 0 else 0
          sp = EasyPreprocessor(verbose=verbose, types=types)
          X_train = sp.fit_transform(X.iloc[train], y.iloc[train])
          X_test = sp.transform(X.iloc[test])
          data_preproc.append(
              (X_train, X_test, y.iloc[train], y.iloc[test])
          )
  
      estimators = self._get_estimators()
      rank_scoring = self._rank_scoring
      self.current_best_ = {rank_scoring: -np.inf}
      for est in estimators:
          set_random_state(est, self.random_state)
          scorers = _check_multimetric_scoring(est, self.scoring_)
          scores = self._evaluate_one(est, data_preproc, scorers)
          # make scoring configurable
          if scores[rank_scoring] > self.current_best_[rank_scoring]:
              if self.verbose:
                  print(
                      "=== new best {} (using {}):".format(
                          scores.name, rank_scoring
                      )
                  )
                  print(_format_scores(scores))
                  print()
  
              self.current_best_ = scores
              best_est = est
      if self.verbose:
          print(
              "\nBest model:\n{}\nBest Scores:\n{}".format(
                  repr(best_est), _format_scores(self.current_best_)
              )
          )
      if self.refit:
          with warnings.catch_warnings():
              warnings.simplefilter("ignore", UserWarning)
              self.est_ = make_pipeline(
                  EasyPreprocessor(types=types), best_est
              )
              self.est_.fit(X, y)
      return self
  
imports: from importlib.metadata import version
  import warnings
  import numpy
  import pandas
  import sklearn
  from sklearn.metrics import make_scorer, average_precision_score
  from sklearn.base import BaseEstimator, ClassifierMixin, RegressorMixin
  from sklearn.preprocessing import LabelEncoder
  from sklearn.utils.multiclass import type_of_target
  from sklearn.pipeline import make_pipeline, Pipeline
  from sklearn.exceptions import UndefinedMetricWarning
  from sklearn.model_selection import StratifiedKFold, KFold
  from sklearn.model_selection._validation import _fit_and_score
  from sklearn.utils.validation import check_is_fitted
  from dabl._available_if import available_if
  from sklearn.dummy import DummyClassifier
  from sklearn.experimental import enable_halving_search_cv
  from sklearn.model_selection import HalvingGridSearchCV
  from .preprocessing import EasyPreprocessor, detect_types
  from .pipelines import get_fast_classifiers, get_fast_regressors, get_any_classifiers
  from .utils import _validate_Xyt
label_desc: Use image node_id 3 for calling the _BaseSimpleEstimator obj's underlying member method code with example usage: obj._fit(X, y, target_col) and returns: self