code: def prepare_data():
      """
      Generate data with target variable:
  
      p(Y) = 1/ (1 + exp(-(-3 + 0.5X1 + 0.5X2 - 0.5X3 + 2X2X3)))
  
      :return: Dataframe, X, and y
      """
  
      # Setup the simulation
      n = 1000  # Number of records in the simulated data
  
      # Simulate three predictors
      np.random.seed(0)
      X1 = np.random.normal(0, 1, size=n)
      np.random.seed(1)
      X2 = np.random.normal(0, 1, size=n)
      np.random.seed(2)
      X3 = np.random.normal(0, 1, size=n)
  
      # Simulate a ranuni for assigning Y
      np.random.seed(3)
      R = np.random.uniform(0, 1, size=n)
  
      # Put values in dataframe
      df = pd.DataFrame(
          {"id": range(1, n + 1), "X1": X1, "X2": X2, "X3": X3, "R": R}
      )
  
      # Define the linear predictor
      B0 = -3
      B1 = 0.5
      B2 = 0.5
      B3 = -0.5
      B12 = 0
      B13 = 0
      B23 = 2
      df["LP"] = (
          B0
          + B1 * df["X1"]
          + B2 * df["X2"]
          + B3 * df["X3"]
          + B12 * df["X1"] * df["X2"]
          + B13 * df["X1"] * df["X3"]
          + B23 * df["X2"] * df["X3"]
      )
  
      # Convert it to a probability
      df["P"] = 1 / (1 + np.exp(-df["LP"]))
  
      # Convert it to a binary target
      df["Y"] = (df["R"] < df["P"]).astype(int)
  
      # Define target and predictors
      X = ["X1", "X2", "X3"]
      y = "Y"
  
      return df, X, y
  
file_path: h2o-3/h2o-py/tests/testdir_hstats/pyunit_h_pubdev-8768_synthetic_data.py
imports: from builtins import range
  import sys, os
  import h2o
  from tests import pyunit_utils, assert_equals
  from h2o.estimators import H2OGradientBoostingEstimator, H2OXGBoostEstimator
  import numpy
  import pandas
  import imp
label_desc: Use image node_id 1 for calling a global function with example usage: prepare_data() and returns: df,  X,  y