class_docstr: Callable objective function to be used with optuna.
class_docstr_tok: ["Callable","objective","function","to","be","used","with","optuna","."]
code: def __init__(
      self,
      X_train: pd.DataFrame,
      y_train: pd.Series,
      X_val: pd.DataFrame,
      y_val: pd.Series,
      threshold: Threshold,
      eval_metric: str,
      preprocessing_method: PreProcessing,
      inprocessing_method: InProcessing,
      postprocessing_method: PostProcessing,
      preprocessing_configs: Optional[DictConfig],
      inprocessing_configs: Optional[DictConfig],
      postprocessing_configs: Optional[DictConfig],
      s_train: pd.Series = None,
      s_val: pd.Series = None,
      X_test: pd.DataFrame = None,
      y_test: pd.DataFrame = None,
      s_test: pd.Series = None,
      other_eval_metric: Optional[str] = None,
      alpha: Optional[float] = 0.50,
      artifacts: Optional[list[str]] = (),
      artifacts_folder: Path = None,
  ):
      self.X_train, self.y_train, self.s_train = (
          X_train,
          y_train,
          s_train,
      )
      self.X_val, self.y_val, self.s_val = (X_val, y_val, s_val)
      self.X_test, self.y_test, self.s_test = (X_test, y_test, s_test)
  
      self.preprocessing_method = preprocessing_method
      self.inprocessing_method = inprocessing_method
      self.postprocessing_method = postprocessing_method
      self.threshold = threshold
  
      self.preprocessing_configs = self.omegaconf_to_dict(
          preprocessing_configs
      )
      self.inprocessing_configs = self.omegaconf_to_dict(
          inprocessing_configs
      )
      self.postprocessing_configs = self.omegaconf_to_dict(
          postprocessing_configs
      )
  
      self.configs = self.join_configs(
          self.inprocessing_configs,
          self.preprocessing_configs,
          self.postprocessing_configs,
      )
  
      self.eval_metric = eval_metric
      self.other_eval_metric = other_eval_metric
      self.alpha = alpha
      assert alpha is None or (0 <= alpha <= 1)
  
      # Store all results in a list as models are trained
      self._models_results: list[
          ObjectiveFunction.TrialResults
      ] = list()
      self.artifacts = artifacts
      self.artifacts_folder = artifacts_folder
  
imports: import dataclasses
  import logging
  import pickle
  import time
  from pathlib import Path
  from typing import Optional, Union
  import numpy
  import pandas
  from hpt.suggest import suggest_callable_hyperparams
  from omegaconf import DictConfig, OmegaConf
  from optuna.trial import BaseTrial
  from ..evaluation import evaluate_fairness, evaluate_performance
  from ..methods import InProcessing, PostProcessing, PreProcessing
  from ..methods.postprocessing.threshold import Threshold
label_desc: Use image node_id 5 to create a new ObjectiveFunction object  with example: obj = ObjectiveFunction(X_train, y_train, X_val, y_val, threshold, eval_metric, preprocessing_method, inprocessing_method, postprocessing_method, preprocessing_configs, inprocessing_configs, postprocessing_configs, s_train, s_val, X_test, y_test, s_test, other_eval_metric, alpha, artifacts, artifacts_folder)