class_docstr: Hyperparameter search with cross-validation.
  
  Args:
      estimator:
          Object to use to fit the data. This is assumed to implement the
          scikit-learn estimator interface. Either this needs to provide
          ``score``, or ``scoring`` must be passed.
  
      param_distributions:
          Dictionary where keys are parameters and values are distributions.
          Distributions are assumed to implement the optuna distribution
          interface.
  
      cv:
          Cross-validation strategy. Possible inputs for cv are:
  
          - :obj:`None`, to use the default 5-fold cross validation,
          - integer to specify the number of folds in a CV splitter,
          - `CV splitter <https://scikit-learn.org/stable/glossary.html#term-CV-splitter>`_,
          - an iterable yielding (train, validation) splits as arrays of indices.
  
          For integer, if ``estimator`` is a classifier and ``y`` is
          either binary or multiclass,
          ``sklearn.model_selection.StratifiedKFold`` is used. otherwise,
          ``sklearn.model_selection.KFold`` is used.
  
      enable_pruning:
          If :obj:`True`, pruning is performed in the case where the
          underlying estimator supports ``partial_fit``.
  
      error_score:
          Value to assign to the score if an error occurs in fitting. If
          'raise', the error is raised. If numeric,
          ``sklearn.exceptions.FitFailedWarning`` is raised. This does not
          affect the refit step, which will always raise the error.
  
      max_iter:
          Maximum number of epochs. This is only used if the underlying
          estimator supports ``partial_fit``.
  
      n_jobs:
          Number of :obj:`threading` based parallel jobs. :obj:`None` means ``1``.
          ``-1`` means using the number is set to CPU count.
  
              .. note::
                  ``n_jobs`` allows parallelization using :obj:`threading` and may suffer from
                  `Python's GIL <https://wiki.python.org/moin/GlobalInterpreterLock>`_.
                  It is recommended to use :ref:`process-based parallelization<distributed>`
                  if ``func`` is CPU bound.
  
      n_trials:
          Number of trials. If :obj:`None`, there is no limitation on the
          number of trials. If ``timeout`` is also set to :obj:`None`,
          the study continues to create trials until it receives a
          termination signal such as Ctrl+C or SIGTERM. This trades off
          runtime vs quality of the solution.
  
      random_state:
          Seed of the pseudo random number generator. If int, this is the
          seed used by the random number generator. If
          ``numpy.random.RandomState`` object, this is the random number
          generator. If :obj:`None`, the global random state from
          ``numpy.random`` is used.
  
      refit:
          If :obj:`True`, refit the estimator with the best found
          hyperparameters. The refitted estimator is made available at the
          ``best_estimator_`` attribute and permits using ``predict``
          directly.
  
      return_train_score:
          If :obj:`True`, training scores will be included. Computing
          training scores is used to get insights on how different
          hyperparameter settings impact the overfitting/underfitting
          trade-off. However computing training scores can be
          computationally expensive and is not strictly required to select
          the hyperparameters that yield the best generalization
          performance.
  
      scoring:
          String or callable to evaluate the predictions on the validation data.
          If :obj:`None`, ``score`` on the estimator is used.
  
      study:
          Study corresponds to the optimization task. If :obj:`None`, a new
          study is created.
  
      subsample:
          Proportion of samples that are used during hyperparameter search.
  
          - If int, then draw ``subsample`` samples.
          - If float, then draw ``subsample`` * ``X.shape[0]`` samples.
  
      timeout:
          Time limit in seconds for the search of appropriate models. If
          :obj:`None`, the study is executed without time limitation. If
          ``n_trials`` is also set to :obj:`None`, the study continues to
          create trials until it receives a termination signal such as
          Ctrl+C or SIGTERM. This trades off runtime vs quality of the
          solution.
  
      verbose:
          Verbosity level. The higher, the more messages.
  
      callbacks:
          List of callback functions that are invoked at the end of each trial. Each function
          must accept two parameters with the following types in this order:
          :class:`~optuna.study.Study` and :class:`~optuna.trial.FrozenTrial`.
  
          .. seealso::
  
              See the tutorial of :ref:`optuna_callback` for how to use and implement
              callback functions.
  
  Attributes:
      best_estimator_:
          Estimator that was chosen by the search. This is present only if
          ``refit`` is set to :obj:`True`.
  
      n_splits_:
          Number of cross-validation splits.
  
      refit_time_:
          Time for refitting the best estimator. This is present only if
          ``refit`` is set to :obj:`True`.
  
      sample_indices_:
          Indices of samples that are used during hyperparameter search.
  
      scorer_:
          Scorer function.
  
      study_:
          Actual study.
  
  Examples:
  
      .. testcode::
  
          import optuna
          from sklearn.datasets import load_iris
          from sklearn.svm import SVC
  
          clf = SVC(gamma="auto")
          param_distributions = {
              "C": optuna.distributions.FloatDistribution(1e-10, 1e10, log=True)
          }
          optuna_search = optuna.integration.OptunaSearchCV(clf, param_distributions)
          X, y = load_iris(return_X_y=True)
          optuna_search.fit(X, y)
          y_pred = optuna_search.predict(X)
  
  .. note::
      By following the scikit-learn convention for scorers, the direction of optimization is
      ``maximize``. See https://scikit-learn.org/stable/modules/model_evaluation.html.
      For the minimization problem, please multiply ``-1``.
class_docstr_tok: ["Hyperparameter","search","with","cross-validation",".","Args",":","estimator",":","Object","to","use","to","fit","the","data",".","This","is","assumed","to","implement","the","scikit-learn","estimator","interface",".","Either","this","needs","to","provide","``","score","``",",","or","``","scoring","``","must","be","passed",".","param_distributions",":","Dictionary","where","keys","are","parameters","and","values","are","distributions",".","Distributions","are","assumed","to","implement","the","optuna","distribution","interface",".","cv",":","Cross-validation","strategy",".","Possible","inputs","for","cv","are",":","-",":","obj",":","`","None","`",",","to","use","the","default","5-fold","cross","validation",",","-","integer","to","specify","the","number","of","folds","in","a","CV","splitter",",","-","`","CV","splitter","<","https",":","\/\/scikit-learn.org\/stable\/glossary.html","#","term-CV-splitter",">","`","_",",","-","an","iterable","yielding","(","train",",","validation",")","splits","as","arrays","of","indices",".","For","integer",",","if","``","estimator","``","is","a","classifier","and","``","y","``","is","either","binary","or","multiclass",",","``","sklearn.model_selection.StratifiedKFold","``","is","used",".","otherwise",",","``","sklearn.model_selection.KFold","``","is","used",".","enable_pruning",":","If",":","obj",":","`","True","`",",","pruning","is","performed","in","the","case","where","the","underlying","estimator","supports","``","partial_fit","``",".","error_score",":","Value","to","assign","to","the","score","if","an","error","occurs","in","fitting",".","If","'raise","'",",","the","error","is","raised",".","If","numeric",",","``","sklearn.exceptions.FitFailedWarning","``","is","raised",".","This","does","not","affect","the","refit","step",",","which","will","always","raise","the","error",".","max_iter",":","Maximum","number","of","epochs",".","This","is","only","used","if","the","underlying","estimator","supports","``","partial_fit","``",".","n_jobs",":","Number","of",":","obj",":","`","threading","`","based","parallel","jobs",".",":","obj",":","`","None","`","means","``","1","``",".","``","-1","``","means","using","the","number","is","set","to","CPU","count",".","..","note",":",":","``","n_jobs","``","allows","parallelization","using",":","obj",":","`","threading","`","and","may","suffer","from","`","Python","'s","GIL","<","https",":","\/\/wiki.python.org\/moin\/GlobalInterpreterLock",">","`","_",".","It","is","recommended","to","use",":","ref",":","`","process-based","parallelization","<","distributed",">","`","if","``","func","``","is","CPU","bound",".","n_trials",":","Number","of","trials",".","If",":","obj",":","`","None","`",",","there","is","no","limitation","on","the","number","of","trials",".","If","``","timeout","``","is","also","set","to",":","obj",":","`","None","`",",","the","study","continues","to","create","trials","until","it","receives","a","termination","signal","such","as","Ctrl+C","or","SIGTERM",".","This","trades","off","runtime","vs","quality","of","the","solution",".","random_state",":","Seed","of","the","pseudo","random","number","generator",".","If","int",",","this","is","the","seed","used","by","the","random","number","generator",".","If","``","numpy.random.RandomState","``","object",",","this","is","the","random","number","generator",".","If",":","obj",":","`","None","`",",","the","global","random","state","from","``","numpy.random","``","is","used",".","refit",":","If",":","obj",":","`","True","`",",","refit","the","estimator","with","the","best","found","hyperparameters",".","The","refitted","estimator","is","made","available","at","the","``","best_estimator_","``","attribute","and","permits","using","``","predict","``","directly",".","return_train_score",":","If",":","obj",":","`","True","`",",","training","scores","will","be","included",".","Computing","training","scores","is","used","to","get","insights","on","how","different","hyperparameter","settings","impact","the","overfitting\/underfitting","trade-off",".","However","computing","training","scores","can","be","computationally","expensive","and","is","not","strictly","required","to","select","the","hyperparameters","that","yield","the","best","generalization","performance",".","scoring",":","String","or","callable","to","evaluate","the","predictions","on","the","validation","data",".","If",":","obj",":","`","None","`",",","``","score","``","on","the","estimator","is","used",".","study",":","Study","corresponds","to","the","optimization","task",".","If",":","obj",":","`","None","`",",","a","new","study","is","created",".","subsample",":","Proportion","of","samples","that","are","used","during","hyperparameter","search",".","-","If","int",",","then","draw","``","subsample","``","samples",".","-","If","float",",","then","draw","``","subsample","``","*","``","X.shape","[","0","]","``","samples",".","timeout",":","Time","limit","in","seconds","for","the","search","of","appropriate","models",".","If",":","obj",":","`","None","`",",","the","study","is","executed","without","time","limitation",".","If","``","n_trials","``","is","also","set","to",":","obj",":","`","None","`",",","the","study","continues","to","create","trials","until","it","receives","a","termination","signal","such","as","Ctrl+C","or","SIGTERM",".","This","trades","off","runtime","vs","quality","of","the","solution",".","verbose",":","Verbosity","level",".","The","higher",",","the","more","messages",".","callbacks",":","List","of","callback","functions","that","are","invoked","at","the","end","of","each","trial",".","Each","function","must","accept","two","parameters","with","the","following","types","in","this","order",":",":","class",":","`","~optuna.study.Study","`","and",":","class",":","`","~optuna.trial.FrozenTrial","`",".","..","seealso",":",":","See","the","tutorial","of",":","ref",":","`","optuna_callback","`","for","how","to","use","and","implement","callback","functions",".","Attributes",":","best_estimator_",":","Estimator","that","was","chosen","by","the","search",".","This","is","present","only","if","``","refit","``","is","set","to",":","obj",":","`","True","`",".","n_splits_",":","Number","of","cross-validation","splits",".","refit_time_",":","Time","for","refitting","the","best","estimator",".","This","is","present","only","if","``","refit","``","is","set","to",":","obj",":","`","True","`",".","sample_indices_",":","Indices","of","samples","that","are","used","during","hyperparameter","search",".","scorer_",":","Scorer","function",".","study_",":","Actual","study",".","Examples",":","..","testcode",":",":","import","optuna","from","sklearn.datasets","import","load_iris","from","sklearn.svm","import","SVC","clf","=","SVC","(","gamma=","''","auto","''",")","param_distributions","=","{","``","C","''",":","optuna.distributions.FloatDistribution","(","1e-10",",","1e10",",","log=True",")","}","optuna_search","=","optuna.integration.OptunaSearchCV","(","clf",",","param_distributions",")","X",",","y","=","load_iris","(","return_X_y=True",")","optuna_search.fit","(","X",",","y",")","y_pred","=","optuna_search.predict","(","X",")","..","note",":",":","By","following","the","scikit-learn","convention","for","scorers",",","the","direction","of","optimization","is","``","maximize","``",".","See","https",":","\/\/scikit-learn.org\/stable\/modules\/model_evaluation.html",".","For","the","minimization","problem",",","please","multiply","``","-1","``","."]
code: def _more_tags(self) -> dict[str, bool]:
      return {"non_deterministic": True, "no_validation": True}
  
imports: from __future__ import annotations
  from collections.abc import Callable
  from collections.abc import Iterable
  from collections.abc import Mapping
  from logging import DEBUG
  from logging import INFO
  from logging import WARNING
  from numbers import Integral
  from numbers import Number
  from time import time
  from typing import Any
  from typing import List
  from typing import Union
  import numpy
  from optuna import distributions
  from optuna import logging
  from optuna import samplers
  from optuna import study
  from optuna import TrialPruned
  from optuna._experimental import experimental_class
  from optuna._imports import try_import
  from optuna.distributions import _convert_old_distribution_to_new_distribution
  from optuna.study import StudyDirection
  from optuna.terminator import report_cross_validation_scores
  from optuna.trial import FrozenTrial
  from optuna.trial import Trial
label_desc: Use image node_id 23 for calling the OptunaSearchCV obj's underlying member method code with example usage: obj._more_tags() and returns: dict