code: def test_mixed_pipeline_with_numpy_arrays():
      # Note that in normal situations (release build), init_connection_args can be omitted
      # otherwise, it should be set to the first H2O element in the pipeline
      with h2o_connection(**init_connection_args):
          pipeline = Pipeline(
              [
                  ("svd", TruncatedSVD(random_state=seed)),
                  (
                      "estimator",
                      H2OGradientBoostingClassifier(seed=seed),
                  ),
              ]
          )
  
          params = dict(
              svd__n_components=[2, 3],
              estimator__ntrees=[5, 10],
              estimator__max_depth=[1, 2, 3],
              estimator__learn_rate=[0.1, 0.2],
          )
          search = RandomizedSearchCV(
              pipeline,
              params,
              n_iter=5,
              scoring="accuracy",
              cv=3,
              random_state=seed,
              n_jobs=1,
          )
          data = _get_data(format="numpy", n_classes=3)
          assert isinstance(data.X_train, np.ndarray)
  
          search.fit(data.X_train, data.y_train)
          preds = search.predict(data.X_test)
          assert isinstance(preds, np.ndarray)
          assert preds.shape == (len(data.X_test),)
          probs = search.predict_proba(data.X_test)
          assert probs.shape == (len(data.X_test), 3)
          assert np.allclose(
              np.sum(probs, axis=1), 1.0
          ), "`predict_proba` didn't return probabilities"
  
          score = search.score(data.X_test, data.y_test)
          assert isinstance(score, float)
          skl_score = accuracy_score(data.y_test, preds)
          assert (
              abs(score - skl_score) < 1e-6
          ), "score={}, skl_score={}".format(score, skl_score)
          scores["mixed_pipeline_with_numpy_arrays"] = score
  
file_path: h2o-3/h2o-py/tests/testdir_sklearn/pyunit_sklearn_classification_search_pipeline.py
imports: import importlib, inspect, os, sys
  import numpy
  from sklearn.datasets import make_classification
  from sklearn.decomposition import TruncatedSVD
  from sklearn.metrics import accuracy_score, make_scorer
  from sklearn.model_selection import train_test_split, RandomizedSearchCV
  from sklearn.pipeline import Pipeline
  import h2o
  from h2o.cross_validation import H2OKFold
  from h2o.sklearn import h2o_connection, H2OGradientBoostingEstimator, H2OGradientBoostingClassifier, H2OSVD
  from h2o.sklearn.wrapper import H2OConnectionMonitorMixin
  from tests import pyunit_utils, Namespace
label_desc: Use image node_id 5 for calling a global function with example usage: test_mixed_pipeline_with_numpy_arrays() without return types