code: def generate_baseline_data(include_cat):
      X, y = datasets.make_friedman1(
          n_samples=NUM_SAMPLES, n_features=5, noise=100, random_state=1
      )
  
      # convert  to a binomial
      prob = 1 / (1 + np.exp(-y))
      y = np.random.binomial(1, prob)
  
      print("Event rate = {0:4.4f}".format(np.sum(y) / NUM_SAMPLES))
  
      data = np.hstack((y.reshape(-1, 1), X))
      data = pd.DataFrame(
          data, columns=["y", "x0", "x1", "x2", "x3", "x4"]
      )
  
      if include_cat is True:
          data["c"] = data.apply(
              lambda row: "A" if row.y == 1 else "B", axis=1
          )
  
      return data
  
file_path: h2o-3/h2o-py/tests/testdir_misc/pyunit_pubdev_4697_early_stop_gbm.py
imports: import sys
  import h2o
  from tests import pyunit_utils
  import random
  from h2o.estimators.gbm import H2OGradientBoostingEstimator
  import numpy
  import pandas
  from sklearn import datasets
label_desc: Use image node_id 1 for calling a global function with example usage: generate_baseline_data(include_cat) and returns: data