code: def test_equivalent_model_specifications(n_intervals, n_estimators):
      """Test composable TSF vs an equivalent model."""
      random_state = 1234
      X_train, y_train = load_unit_test(split="train")
      X_test, y_test = load_unit_test(split="test")
  
      # Due to tie-breaking/floating point rounding in the final decision tree
      # classifier, the results depend on the
      # exact column order of the input data
  
      # Compare pipeline predictions outside of ensemble.
      steps = [
          (
              "segment",
              RandomIntervalSegmenter(
                  n_intervals=n_intervals, random_state=random_state
              ),
          ),
          (
              "transform",
              FeatureUnion(
                  [("mean", mean_transformer), ("std", std_transformer)]
              ),
          ),
          (
              "clf",
              DecisionTreeClassifier(
                  random_state=random_state, max_depth=2
              ),
          ),
      ]
      clf1 = Pipeline(steps)
      clf1.fit(X_train, y_train)
      a = clf1.predict(X_test)
  
      steps = [
          (
              "transform",
              RandomIntervalFeatureExtractor(
                  n_intervals=n_intervals,
                  features=[np.mean, np.std],
                  random_state=random_state,
              ),
          ),
          (
              "clf",
              DecisionTreeClassifier(
                  random_state=random_state, max_depth=2
              ),
          ),
      ]
      clf2 = Pipeline(steps)
      clf2.fit(X_train, y_train)
      b = clf2.predict(X_test)
      np.array_equal(a, b)
  
file_path: sktime/sktime/classification/ensemble/tests/test_ensemble.py
imports: import numpy
  import pytest
  from sklearn.pipeline import Pipeline
  from sklearn.preprocessing import FunctionTransformer
  from sklearn.tree import DecisionTreeClassifier
  from sktime.classification.ensemble import ComposableTimeSeriesForestClassifier
  from sktime.datasets import load_unit_test
  from sktime.tests.test_switch import run_test_for_class
  from sktime.transformations.compose import FeatureUnion
  from sktime.transformations.panel.segment import RandomIntervalSegmenter
  from sktime.transformations.panel.summarize import RandomIntervalFeatureExtractor
  from sktime.transformations.series.adapt import TabularToSeriesAdaptor
  from sktime.utils._testing.panel import make_classification_problem
  from sktime.utils.slope_and_trend import _slope
label_desc: Use image node_id 2 for calling a global function with example usage: test_equivalent_model_specifications(n_intervals, n_estimators) without return types