code: def experiment(objective, label_type, data):
      """Measure performance of an objective.
  
      Parameters
      ----------
      objective : {'binary', 'xentropy'}
          Objective function.
      label_type : {'binary', 'probability'}
          Type of the label.
      data : dict
          Data for training.
  
      Returns
      -------
      result : dict
          Experiment summary stats.
      """
      np.random.seed(0)
      nrounds = 5
      lgb_data = data[f"lgb_with_{label_type}_labels"]
      params = {
          "objective": objective,
          "feature_fraction": 1,
          "bagging_fraction": 1,
          "verbose": -1,
      }
      time_zero = time.time()
      gbm = lgb.train(params, lgb_data, num_boost_round=nrounds)
      y_fitted = gbm.predict(data["X"])
      y_true = data[f"{label_type}_labels"]
      duration = time.time() - time_zero
      return {
          "time": duration,
          "correlation": np.corrcoef(y_fitted, y_true)[0, 1],
          "logloss": log_loss(y_fitted, y_true),
      }
  
imports: import time
  import numpy
  import pandas
  from scipy.special import expit
  import lightgbm
label_desc: Use image node_id 2 for calling a global function with example usage: experiment(objective, label_type, data) and returns: dict