docstr: Parameters
  ----------
  time_left_for_this_task : int, optional (default=3600)
      Time limit in seconds for the search of appropriate
      models. By increasing this value, *auto-sklearn* has a higher
      chance of finding better models.
  
  per_run_time_limit : int, optional (default=1/10 of time_left_for_this_task)
      Time limit for a single call to the machine learning model.
      Model fitting will be terminated if the machine learning
      algorithm runs over the time limit. Set this value high enough so
      that typical machine learning algorithms can be fit on the
      training data.
  
  ensemble_size : int, optional
      Number of models added to the ensemble built by *Ensemble
      selection from libraries of models*. Models are drawn with
      replacement. If set to ``0`` no ensemble is fit.
  
      Deprecated - will be removed in Auto-sklearn 0.16. Please pass
      this argument via ``ensemble_kwargs={"ensemble_size": int}``
      if you want to change the ensemble size for ensemble selection.
  
  ensemble_class : Type[AbstractEnsemble], optional (default=EnsembleSelection)
      Class implementing the post-hoc ensemble algorithm. Set to
      ``None`` to disable ensemble building or use ``SingleBest``
      to obtain only use the single best model instead of an
      ensemble.
  
  ensemble_kwargs : Dict, optional
      Keyword arguments that are passed to the ensemble class upon
      initialization.
  
  max_models_on_disc: int, optional (default=50),
      Defines the maximum number of models that are kept in the disc.
      The additional number of models are permanently deleted. Due to the
      nature of this variable, it sets the upper limit on how many models
      can be used for an ensemble.
      It must be an integer greater or equal than 1.
      If set to None, all models are kept on the disc.
  
  seed : int, optional (default=1)
      Used to seed SMAC. Will determine the output file names.
  
  memory_limit : int, optional (3072)
      Memory limit in MB for the machine learning algorithm.
      `auto-sklearn` will stop fitting the machine learning algorithm if
      it tries to allocate more than ``memory_limit`` MB.
  
      **Important notes:**
  
      * If ``None`` is provided, no memory limit is set.
      * In case of multi-processing, ``memory_limit`` will be *per job*, so the total usage is
        ``n_jobs x memory_limit``.
      * The memory limit also applies to the ensemble creation process.
  
  tmp_folder : string, optional (None)
      folder to store configuration output and log files, if ``None``
      automatically use ``/tmp/autosklearn_tmp_$pid_$random_number``
  
  delete_tmp_folder_after_terminate: string, optional (True)
      remove tmp_folder, when finished. If tmp_folder is None
      tmp_dir will always be deleted
  
  n_jobs : int, optional, experimental
      The number of jobs to run in parallel for ``fit()``. ``-1`` means
      using all processors.
  
      **Important notes**:
  
      * By default, Auto-sklearn uses one core.
      * Ensemble building is not affected by ``n_jobs`` but can be controlled by the number
        of models in the ensemble.
      * ``predict()`` is not affected by ``n_jobs`` (in contrast to most scikit-learn models)
      * If ``dask_client`` is ``None``, a new dask client is created.
  
  dask_client : dask.distributed.Client, optional
      User-created dask client, can be used to start a dask cluster and then
      attach auto-sklearn to it.
  
  disable_evaluator_output: bool or list, optional (False)
      If True, disable model and prediction output. Cannot be used
      together with ensemble building. ``predict()`` cannot be used when
      setting this True. Can also be used as a list to pass more
      fine-grained information on what to save. Allowed elements in the
      list are:
  
      * ``'y_optimization'`` : do not save the predictions for the
        optimization/validation set, which would later on be used to build
        an ensemble.
      * ``model`` : do not save any model files
  
  smac_scenario_args : dict, optional (None)
      Additional arguments inserted into the scenario of SMAC. See the
      `SMAC documentation <https://automl.github.io/SMAC3/main/api/smac.scenario.html#smac.scenario.Scenario>`_
      for a list of available arguments.
  
  logging_config : dict, optional (None)
      dictionary object specifying the logger configuration. If None,
      the default logging.yaml file is used, which can be found in
      the directory ``util/logging.yaml`` relative to the installation.
  
  metric : Scorer, optional (None)
      An instance of :class:`autosklearn.metrics.Scorer` as created by
      :meth:`autosklearn.metrics.make_scorer`. These are the `Built-in
      Metrics`_.
      If None is provided, a default metric is selected depending on the task.
  
  scoring_functions : List[Scorer], optional (None)
      List of scorers which will be calculated for each pipeline and results will be
      available via ``cv_results``
  
  load_models : bool, optional (True)
      Whether to load the models after fitting Auto-sklearn.
  
  disable_progress_bar: bool = False
      Whether to disable the progress bar that is displayed in the console
      while fitting to the training data.
  
  Attributes
  ----------
  
  cv_results_ : dict of numpy (masked) ndarrays
      A dict with keys as column headers and values as columns, that can be
      imported into a pandas ``DataFrame``.
  
      Not all keys returned by scikit-learn are supported yet.
docstr_tok: ["Parameters","--","--","--","--","--","time_left_for_this_task",":","int",",","optional","(","default=3600",")","Time","limit","in","seconds","for","the","search","of","appropriate","models",".","By","increasing","this","value",",","*","auto-sklearn","*","has","a","higher","chance","of","finding","better","models",".","per_run_time_limit",":","int",",","optional","(","default=1\/10","of","time_left_for_this_task",")","Time","limit","for","a","single","call","to","the","machine","learning","model",".","Model","fitting","will","be","terminated","if","the","machine","learning","algorithm","runs","over","the","time","limit",".","Set","this","value","high","enough","so","that","typical","machine","learning","algorithms","can","be","fit","on","the","training","data",".","ensemble_size",":","int",",","optional","Number","of","models","added","to","the","ensemble","built","by","*","Ensemble","selection","from","libraries","of","models","*",".","Models","are","drawn","with","replacement",".","If","set","to","``","0","``","no","ensemble","is","fit",".","Deprecated","-","will","be","removed","in","Auto-sklearn","0.16",".","Please","pass","this","argument","via","``","ensemble_kwargs=","{","``","ensemble_size","''",":","int","}","``","if","you","want","to","change","the","ensemble","size","for","ensemble","selection",".","ensemble_class",":","Type","[","AbstractEnsemble","]",",","optional","(","default=EnsembleSelection",")","Class","implementing","the","post-hoc","ensemble","algorithm",".","Set","to","``","None","``","to","disable","ensemble","building","or","use","``","SingleBest","``","to","obtain","only","use","the","single","best","model","instead","of","an","ensemble",".","ensemble_kwargs",":","Dict",",","optional","Keyword","arguments","that","are","passed","to","the","ensemble","class","upon","initialization",".","max_models_on_disc",":","int",",","optional","(","default=50",")",",","Defines","the","maximum","number","of","models","that","are","kept","in","the","disc",".","The","additional","number","of","models","are","permanently","deleted",".","Due","to","the","nature","of","this","variable",",","it","sets","the","upper","limit","on","how","many","models","can","be","used","for","an","ensemble",".","It","must","be","an","integer","greater","or","equal","than","1",".","If","set","to","None",",","all","models","are","kept","on","the","disc",".","seed",":","int",",","optional","(","default=1",")","Used","to","seed","SMAC",".","Will","determine","the","output","file","names",".","memory_limit",":","int",",","optional","(","3072",")","Memory","limit","in","MB","for","the","machine","learning","algorithm",".","`","auto-sklearn","`","will","stop","fitting","the","machine","learning","algorithm","if","it","tries","to","allocate","more","than","``","memory_limit","``","MB",".","*","*","Important","notes",":","*","*","*","If","``","None","``","is","provided",",","no","memory","limit","is","set",".","*","In","case","of","multi-processing",",","``","memory_limit","``","will","be","*","per","job","*",",","so","the","total","usage","is","``","n_jobs","x","memory_limit","``",".","*","The","memory","limit","also","applies","to","the","ensemble","creation","process",".","tmp_folder",":","string",",","optional","(","None",")","folder","to","store","configuration","output","and","log","files",",","if","``","None","``","automatically","use","``","\/tmp\/autosklearn_tmp_","$","pid_","$","random_number","``","delete_tmp_folder_after_terminate",":","string",",","optional","(","True",")","remove","tmp_folder",",","when","finished",".","If","tmp_folder","is","None","tmp_dir","will","always","be","deleted","n_jobs",":","int",",","optional",",","experimental","The","number","of","jobs","to","run","in","parallel","for","``","fit","(",")","``",".","``","-1","``","means","using","all","processors",".","*","*","Important","notes","*","*",":","*","By","default",",","Auto-sklearn","uses","one","core",".","*","Ensemble","building","is","not","affected","by","``","n_jobs","``","but","can","be","controlled","by","the","number","of","models","in","the","ensemble",".","*","``","predict","(",")","``","is","not","affected","by","``","n_jobs","``","(","in","contrast","to","most","scikit-learn","models",")","*","If","``","dask_client","``","is","``","None","``",",","a","new","dask","client","is","created",".","dask_client",":","dask.distributed.Client",",","optional","User-created","dask","client",",","can","be","used","to","start","a","dask","cluster","and","then","attach","auto-sklearn","to","it",".","disable_evaluator_output",":","bool","or","list",",","optional","(","False",")","If","True",",","disable","model","and","prediction","output",".","Can","not","be","used","together","with","ensemble","building",".","``","predict","(",")","``","can","not","be","used","when","setting","this","True",".","Can","also","be","used","as","a","list","to","pass","more","fine-grained","information","on","what","to","save",".","Allowed","elements","in","the","list","are",":","*","``","'y_optimization","'","``",":","do","not","save","the","predictions","for","the","optimization\/validation","set",",","which","would","later","on","be","used","to","build","an","ensemble",".","*","``","model","``",":","do","not","save","any","model","files","smac_scenario_args",":","dict",",","optional","(","None",")","Additional","arguments","inserted","into","the","scenario","of","SMAC",".","See","the","`","SMAC","documentation","<","https",":","\/\/automl.github.io\/SMAC3\/main\/api\/smac.scenario.html","#","smac.scenario.Scenario",">","`","_","for","a","list","of","available","arguments",".","logging_config",":","dict",",","optional","(","None",")","dictionary","object","specifying","the","logger","configuration",".","If","None",",","the","default","logging.yaml","file","is","used",",","which","can","be","found","in","the","directory","``","util\/logging.yaml","``","relative","to","the","installation",".","metric",":","Scorer",",","optional","(","None",")","An","instance","of",":","class",":","`","autosklearn.metrics.Scorer","`","as","created","by",":","meth",":","`","autosklearn.metrics.make_scorer","`",".","These","are","the","`","Built-in","Metrics","`","_",".","If","None","is","provided",",","a","default","metric","is","selected","depending","on","the","task",".","scoring_functions",":","List","[","Scorer","]",",","optional","(","None",")","List","of","scorers","which","will","be","calculated","for","each","pipeline","and","results","will","be","available","via","``","cv_results","``","load_models",":","bool",",","optional","(","True",")","Whether","to","load","the","models","after","fitting","Auto-sklearn",".","disable_progress_bar",":","bool","=","False","Whether","to","disable","the","progress","bar","that","is","displayed","in","the","console","while","fitting","to","the","training","data",".","Attributes","--","--","--","--","--","cv_results_",":","dict","of","numpy","(","masked",")","ndarrays","A","dict","with","keys","as","column","headers","and","values","as","columns",",","that","can","be","imported","into","a","pandas","``","DataFrame","``",".","Not","all","keys","returned","by","scikit-learn","are","supported","yet","."]
code: def __init__(
      self,
      time_left_for_this_task: int = 3600,
      per_run_time_limit=None,
      ensemble_size: int | None = None,
      ensemble_class: AbstractEnsemble | None = EnsembleSelection,
      ensemble_kwargs: Dict[str, Any] | None = None,
      ensemble_nbest: Union[float, int] = 50,
      max_models_on_disc: int = 50,
      seed: int = 1,
      memory_limit: int = 3072,
      tmp_folder: Optional[str] = None,
      delete_tmp_folder_after_terminate: bool = True,
      n_jobs: Optional[int] = None,
      dask_client: Optional[dask.distributed.Client] = None,
      disable_evaluator_output: bool = False,
      smac_scenario_args: Optional[Dict[str, Any]] = None,
      logging_config: Optional[Dict[str, Any]] = None,
      metric: Optional[Scorer] = None,
      scoring_functions: Optional[List[Scorer]] = None,
      load_models: bool = True,
      dataset_compression: Union[bool, Mapping[str, Any]] = True,
      allow_string_features: bool = True,
      disable_progress_bar: bool = False,
  ):
      """
      Parameters
      ----------
      time_left_for_this_task : int, optional (default=3600)
          Time limit in seconds for the search of appropriate
          models. By increasing this value, *auto-sklearn* has a higher
          chance of finding better models.
  
      per_run_time_limit : int, optional (default=1/10 of time_left_for_this_task)
          Time limit for a single call to the machine learning model.
          Model fitting will be terminated if the machine learning
          algorithm runs over the time limit. Set this value high enough so
          that typical machine learning algorithms can be fit on the
          training data.
  
      ensemble_size : int, optional
          Number of models added to the ensemble built by *Ensemble
          selection from libraries of models*. Models are drawn with
          replacement. If set to ``0`` no ensemble is fit.
  
          Deprecated - will be removed in Auto-sklearn 0.16. Please pass
          this argument via ``ensemble_kwargs={"ensemble_size": int}``
          if you want to change the ensemble size for ensemble selection.
  
      ensemble_class : Type[AbstractEnsemble], optional (default=EnsembleSelection)
          Class implementing the post-hoc ensemble algorithm. Set to
          ``None`` to disable ensemble building or use ``SingleBest``
          to obtain only use the single best model instead of an
          ensemble.
  
      ensemble_kwargs : Dict, optional
          Keyword arguments that are passed to the ensemble class upon
          initialization.
  
      max_models_on_disc: int, optional (default=50),
          Defines the maximum number of models that are kept in the disc.
          The additional number of models are permanently deleted. Due to the
          nature of this variable, it sets the upper limit on how many models
          can be used for an ensemble.
          It must be an integer greater or equal than 1.
          If set to None, all models are kept on the disc.
  
      seed : int, optional (default=1)
          Used to seed SMAC. Will determine the output file names.
  
      memory_limit : int, optional (3072)
          Memory limit in MB for the machine learning algorithm.
          `auto-sklearn` will stop fitting the machine learning algorithm if
          it tries to allocate more than ``memory_limit`` MB.
  
          **Important notes:**
  
          * If ``None`` is provided, no memory limit is set.
          * In case of multi-processing, ``memory_limit`` will be *per job*, so the total usage is
            ``n_jobs x memory_limit``.
          * The memory limit also applies to the ensemble creation process.
  
      tmp_folder : string, optional (None)
          folder to store configuration output and log files, if ``None``
          automatically use ``/tmp/autosklearn_tmp_$pid_$random_number``
  
      delete_tmp_folder_after_terminate: string, optional (True)
          remove tmp_folder, when finished. If tmp_folder is None
          tmp_dir will always be deleted
  
      n_jobs : int, optional, experimental
          The number of jobs to run in parallel for ``fit()``. ``-1`` means
          using all processors.
  
          **Important notes**:
  
          * By default, Auto-sklearn uses one core.
          * Ensemble building is not affected by ``n_jobs`` but can be controlled by the number
            of models in the ensemble.
          * ``predict()`` is not affected by ``n_jobs`` (in contrast to most scikit-learn models)
          * If ``dask_client`` is ``None``, a new dask client is created.
  
      dask_client : dask.distributed.Client, optional
          User-created dask client, can be used to start a dask cluster and then
          attach auto-sklearn to it.
  
      disable_evaluator_output: bool or list, optional (False)
          If True, disable model and prediction output. Cannot be used
          together with ensemble building. ``predict()`` cannot be used when
          setting this True. Can also be used as a list to pass more
          fine-grained information on what to save. Allowed elements in the
          list are:
  
          * ``'y_optimization'`` : do not save the predictions for the
            optimization/validation set, which would later on be used to build
            an ensemble.
          * ``model`` : do not save any model files
  
      smac_scenario_args : dict, optional (None)
          Additional arguments inserted into the scenario of SMAC. See the
          `SMAC documentation <https://automl.github.io/SMAC3/main/api/smac.scenario.html#smac.scenario.Scenario>`_
          for a list of available arguments.
  
      logging_config : dict, optional (None)
          dictionary object specifying the logger configuration. If None,
          the default logging.yaml file is used, which can be found in
          the directory ``util/logging.yaml`` relative to the installation.
  
      metric : Scorer, optional (None)
          An instance of :class:`autosklearn.metrics.Scorer` as created by
          :meth:`autosklearn.metrics.make_scorer`. These are the `Built-in
          Metrics`_.
          If None is provided, a default metric is selected depending on the task.
  
      scoring_functions : List[Scorer], optional (None)
          List of scorers which will be calculated for each pipeline and results will be
          available via ``cv_results``
  
      load_models : bool, optional (True)
          Whether to load the models after fitting Auto-sklearn.
  
      disable_progress_bar: bool = False
          Whether to disable the progress bar that is displayed in the console
          while fitting to the training data.
  
      Attributes
      ----------
  
      cv_results_ : dict of numpy (masked) ndarrays
          A dict with keys as column headers and values as columns, that can be
          imported into a pandas ``DataFrame``.
  
          Not all keys returned by scikit-learn are supported yet.
  
      """  # noqa (links are too long)
      self.required_training = (
          False  # Boolean to indicate if selectors were trained.
      )
      include_estimators = [
          "extra_trees",
          "passive_aggressive",
          "random_forest",
          "sgd",
          "gradient_boosting",
          "mlp",
      ]
      include_preprocessors = ["no_preprocessing"]
      include = {
          "classifier": include_estimators,
          "feature_preprocessor": include_preprocessors,
      }
      self.train_selectors(selected_metric=metric)
      super().__init__(
          time_left_for_this_task=time_left_for_this_task,
          per_run_time_limit=per_run_time_limit,
          initial_configurations_via_metalearning=0,
          ensemble_size=ensemble_size,
          ensemble_class=ensemble_class,
          ensemble_kwargs=ensemble_kwargs,
          ensemble_nbest=ensemble_nbest,
          max_models_on_disc=max_models_on_disc,
          seed=seed,
          memory_limit=memory_limit,
          include=include,
          exclude=None,
          resampling_strategy=None,
          resampling_strategy_arguments=None,
          tmp_folder=tmp_folder,
          delete_tmp_folder_after_terminate=delete_tmp_folder_after_terminate,
          n_jobs=n_jobs,
          dask_client=dask_client,
          disable_evaluator_output=disable_evaluator_output,
          get_smac_object_callback=None,
          smac_scenario_args=smac_scenario_args,
          logging_config=logging_config,
          metadata_directory=None,
          metric=metric,
          scoring_functions=scoring_functions,
          load_models=load_models,
          allow_string_features=allow_string_features,
          disable_progress_bar=disable_progress_bar,
      )
  
imports: from __future__ import annotations
  from typing import Any, Dict, List, Mapping, Optional, Union
  import hashlib
  import json
  import os
  import pathlib
  import pickle
  import dask.distributed
  import numpy
  import pandas
  import scipy.sparse
  import sklearn
  from ConfigSpace import Configuration
  import autosklearn
  import autosklearn.experimental.selector
  from autosklearn.classification import AutoSklearnClassifier
  from autosklearn.ensembles.abstract_ensemble import AbstractEnsemble
  from autosklearn.ensembles.ensemble_selection import EnsembleSelection
  from autosklearn.metrics import Scorer, accuracy, balanced_accuracy, log_loss, roc_auc
label_desc: Use image node_id 1 to create a new AutoSklearn2Classifier object from inherited base classes: AutoSklearnClassifier with example: obj = AutoSklearn2Classifier(time_left_for_this_task, per_run_time_limit, ensemble_size, ensemble_class, ensemble_kwargs, ensemble_nbest, max_models_on_disc, seed, memory_limit, tmp_folder, delete_tmp_folder_after_terminate, n_jobs, dask_client, disable_evaluator_output, smac_scenario_args, logging_config, metric, scoring_functions, load_models, dataset_compression, allow_string_features, disable_progress_bar)