class_docstr: Classifier with automatic model selection.
  
  This model uses successive halving on a portfolio of complex models
  (HistGradientBoosting, RandomForest, SVC, LogisticRegression)
  to pick the best model family and hyper-parameters.
  
  AnyClassifier internally applies EasyPreprocessor, so no preprocessing
  is necessary.
  
  Parameters
  ----------
  n_jobs : int, default=None
      Number of processes to spawn for parallelizing the search.
  
  min_resources : {‘exhaust’, ‘smallest’} or int, default=’exhaust’
      The minimum amount of resource that any candidate is allowed to use
      for a given iteration.  Equivalently, this defines the amount of
      resources r0 that are allocated for each candidate at the first
      iteration. See the documentation of HalvingGridSearchCV for more
      information.
  
  verbose : integer, default=0
      Verbosity. Higher means more output.
  
  type_hints : dict or None
          If dict, provide type information for columns.
          Keys are column names, values are types as provided by
          detect_types.
  
   portfolio : str, default='baseline'
           Lets you choose a portfolio. Choose 'baseline' for multiple
           classifiers with default parameters, 'hgb' for
           high-performing HistGradientBoostingClassifiers,
           'svc' for high-performing support vector classifiers,
           'rf' for high-performing random forest classifiers,
           'lr' for high-performing logistic regression classifiers,
           'mixed' for a portfolio of different high-performing
           classifiers.
  
  Attributes
  ----------
  search_ : HalvingGridSearchCV instance
      Fitted HalvingGridSearchCV instance for inspection.
  
  est_ : sklearn estimator
      Best estimator (pipeline) found during search.
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.
      """
      # copy and paste from above?!
      if (
          (y is None and target_col is None)
          or (y is not None)
          and (target_col is not None)
      ):
          raise ValueError("Need to specify either y or target_col.")
      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
      cv = 5
      factor = 3
  
      y, self.scoring_ = self._preprocess_target(y)
      self.log_ = []
  
      # reimplement cross-validation so we only do preprocessing once
      pipe = Pipeline(
          [
              (
                  "preprocessing",
                  EasyPreprocessor(verbose=self.verbose, types=types),
              ),
              ("classifier", DummyClassifier()),
          ]
      )
  
      estimators = self._get_estimators()
      param_grid = [{"classifier": [est]} for est in estimators]
      gs = HalvingGridSearchCV(
          factor=factor,
          estimator=pipe,
          param_grid=param_grid,
          min_resources=self.min_resources,
          verbose=self.verbose,
          cv=cv,
          error_score="raise",
          scoring=self.scoring_,
          refit=True,
          n_jobs=self.n_jobs,
      )
      self.search_ = gs
      with sklearn.config_context(print_changed_only=True):
          gs.fit(X, y)
      self.est_ = gs.best_estimator_
  
      print("best classifier: ", gs.best_params_["classifier"])
      print("best score: {:.3f}".format(gs.best_score_))
  
      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 5 for calling the AnyClassifier obj's underlying member method code with example usage: obj.fit(X, y) and returns: self