code: def test_StackingEstimator_3():
      """Assert that the StackingEstimator worked as expected in scikit-learn pipeline in classification."""
      stack_clf = StackingEstimator(
          estimator=RandomForestClassifier(random_state=42)
      )
      meta_clf = LogisticRegression()
      sklearn_pipeline = make_pipeline(stack_clf, meta_clf)
      # fit in pipeline
      sklearn_pipeline.fit(training_features, training_target)
      # fit step by step
      stack_clf.fit(training_features, training_target)
      X_clf_transformed = stack_clf.transform(training_features)
      meta_clf.fit(X_clf_transformed, training_target)
      # scoring
      score = meta_clf.score(X_clf_transformed, training_target)
      pipeline_score = sklearn_pipeline.score(
          training_features, training_target
      )
      assert np.allclose(score, pipeline_score)
  
      # test cv score
      cv_score = np.mean(
          cross_val_score(
              sklearn_pipeline,
              training_features,
              training_target,
              cv=3,
              scoring="accuracy",
          )
      )
      known_cv_score = 0.9643652561247217
  
      assert np.allclose(known_cv_score, cv_score)
  
file_path: tpot/tests/stacking_estimator_tests.py
imports: import platform
  import numpy
  from tpot.builtins import StackingEstimator
  from sklearn.linear_model import LogisticRegression, Lasso
  from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor
  from sklearn.pipeline import make_pipeline
  from tpot_tests import training_features, training_target, training_features_r, training_target_r
  from sklearn.model_selection import cross_val_score
  import warnings
label_desc: Use image node_id 3 for calling a global function with example usage: test_StackingEstimator_3() without return types