code: def __call__(self, trial):
      try:
          Algorithm = (
              ExtraTreesRegressorAlgorithm
              if self.ml_task == REGRESSION
              else ExtraTreesAlgorithm
          )
          self.objective = (
              "squared_error"
              if self.ml_task == REGRESSION
              else trial.suggest_categorical(
                  "criterion", ["gini", "entropy"]
              )
          )
          params = {
              "max_steps": self.max_steps,
              "criterion": self.objective,
              "max_depth": trial.suggest_int("max_depth", 2, 32),
              "min_samples_split": trial.suggest_int(
                  "min_samples_split", 2, 100
              ),
              "min_samples_leaf": trial.suggest_int(
                  "min_samples_leaf", 1, 100
              ),
              "max_features": trial.suggest_float(
                  "max_features", 0.01, 1
              ),
              "n_jobs": self.n_jobs,
              "seed": self.seed,
              "ml_task": self.ml_task,
          }
          model = Algorithm(params)
  
          model.fit(
              self.X_train,
              self.y_train,
              sample_weight=self.sample_weight,
          )
  
          preds = model.predict(self.X_validation)
  
          score = self.eval_metric(self.y_validation, preds)
          if Metric.optimize_negative(self.eval_metric.name):
              score *= -1.0
  
      except optuna.exceptions.TrialPruned as e:
          raise e
      except Exception as e:
          print("Exception in ExtraTreesObjective", str(e))
          return None
  
      return score
  
imports: import optuna
  from supervised.algorithms.extra_trees import ExtraTreesAlgorithm, ExtraTreesRegressorAlgorithm
  from supervised.algorithms.registry import BINARY_CLASSIFICATION, MULTICLASS_CLASSIFICATION, REGRESSION
  from supervised.utils.metric import Metric
label_desc: Use image node_id 2 for calling the ExtraTreesObjective obj's underlying member method code with example usage: obj.__call__(trial) and returns: score, None