code: def test_regression(df_normal_dist):
      transformer = DecisionTreeDiscretiser(
          cv=3,
          scoring="neg_mean_squared_error",
          variables=None,
          param_grid={"max_depth": [1, 2, 3, 4]},
          regression=True,
          random_state=0,
      )
      np.random.seed(0)
      y = pd.Series(pd.Series(np.random.normal(0, 0.1, 100)))
      X = transformer.fit_transform(df_normal_dist, y)
      X_t = [
          0.19,
          0.04,
          0.11,
          0.23,
          -0.09,
          -0.02,
          0.01,
          0.15,
          0.07,
          -0.26,
          0.09,
          -0.07,
          -0.16,
          -0.2,
          -0.04,
          -0.12,
      ]
  
      # init params
      assert transformer.cv == 3
      assert transformer.variables is None
      assert transformer.scoring == "neg_mean_squared_error"
      assert transformer.regression is True
      # fit params
      assert transformer.variables_ == ["var"]
      assert transformer.n_features_in_ == 1
      assert np.round(transformer.scores_dict_["var"], 3) == np.round(
          -4.4373314584616444e-05, 3
      )
      # transform params
      assert all(
          x for x in np.round(X["var"].unique(), 2) if x not in X_t
      )
  
file_path: feature_engine/tests/test_discretisation/test_decision_tree_discretiser.py
imports: import numpy
  import pandas
  import pytest
  from sklearn.exceptions import NotFittedError
  from feature_engine.discretisation import DecisionTreeDiscretiser, EqualWidthDiscretiser
label_desc: Use image node_id 2 for calling a global function with example usage: test_regression(df_normal_dist) without return types