class_docstr: Callable that implements objective function.
  
  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.
  
      X:
          Training data.
  
      y:
          Target variable.
  
      cv:
          Cross-validation strategy.
  
      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.
  
      fit_params:
          Parameters passed to ``fit`` one the estimator.
  
      groups:
          Group labels for the samples used while splitting the dataset into
          train/validation set.
  
      max_iter:
          Maximum number of epochs. This is only used if the underlying
          estimator supports ``partial_fit``.
  
      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:
          Scorer function.
class_docstr_tok: ["Callable","that","implements","objective","function",".","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",".","X",":","Training","data",".","y",":","Target","variable",".","cv",":","Cross-validation","strategy",".","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",".","fit_params",":","Parameters","passed","to","``","fit","``","one","the","estimator",".","groups",":","Group","labels","for","the","samples","used","while","splitting","the","dataset","into","train\/validation","set",".","max_iter",":","Maximum","number","of","epochs",".","This","is","only","used","if","the","underlying","estimator","supports","``","partial_fit","``",".","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",":","Scorer","function","."]
code: def __init__(
      self,
      estimator: "sklearn.base.BaseEstimator",
      param_distributions: Mapping[str, distributions.BaseDistribution],
      X: TwoDimArrayLikeType,
      y: OneDimArrayLikeType | TwoDimArrayLikeType | None,
      cv: "BaseCrossValidator",
      enable_pruning: bool,
      error_score: Number | float | str,
      fit_params: dict[str, Any],
      groups: OneDimArrayLikeType | None,
      max_iter: int,
      return_train_score: bool,
      scoring: Callable[..., Number],
  ) -> None:
      self.cv = cv
      self.enable_pruning = enable_pruning
      self.error_score = error_score
      self.estimator = estimator
      self.fit_params = fit_params
      self.groups = groups
      self.max_iter = max_iter
      self.param_distributions = param_distributions
      self.return_train_score = return_train_score
      self.scoring = scoring
      self.X = X
      self.y = y
  
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 1 to create a new _Objective object  with example: obj = _Objective(estimator, param_distributions, X, y, cv, enable_pruning, error_score, fit_params, groups, max_iter, return_train_score, scoring)