code: def test_given_categorical_training_data_when_fit_and_predict_polynom_regressor_then_returns_accurate_results():
      def _generate_data():
          X = np.column_stack(
              [
                  np.random.choice(2, 100, replace=True).astype(str),
                  np.random.normal(0, 1, (100, 2)).astype(object),
              ]
          ).astype(object)
          Y = []
          for i in range(X.shape[0]):
              Y.append(
                  X[i, 1] * X[i, 2]
                  if X[i, 0] == "0"
                  else X[i, 1] + X[i, 2]
              )
  
          return X, np.array(Y)
  
      X_training, Y_training = _generate_data()
      X_test, Y_test = _generate_data()
      mdl = create_polynom_regressor(degree=3)
      mdl.fit(X_training, Y_training)
  
      assert mdl.predict(X_test).reshape(-1) == approx(
          Y_test, abs=1e-10
      )
  
imports: import numpy
  from _pytest.python_api import approx
  from flaky import flaky
  from dowhy.gcm.ml.regression import create_polynom_regressor, create_random_forest_regressor
label_desc: Use image node_id 2 for calling a global function with example usage: test_given_categorical_training_data_when_fit_and_predict_polynom_regressor_then_returns_accurate_results() and returns: X,  np