code: def test_predict_low_memory(make_whas500, est_cls, params):
      whas500 = make_whas500(to_numeric=True)
      X, y = whas500.x, whas500.y
  
      X_train, X_test, y_train, _ = train_test_split(
          X, y, random_state=params["random_state"]
      )
  
      est_high = est_cls(**params)
      est_high.set_params(low_memory=False)
      est_high.fit(X_train, y_train)
      pred_high = est_high.predict(X_test)
  
      est_low = est_cls(**params)
      est_low.set_params(low_memory=True)
      est_low.fit(X_train, y_train)
      pred_low = est_low.predict(X_test)
  
      assert pred_high.shape[0] == X_test.shape[0]
      assert pred_low.shape[0] == X_test.shape[0]
  
      assert_array_almost_equal(pred_high, pred_low)
  
      msg = (
          "predict_cumulative_hazard_function is not implemented in low memory mode."
          " run fit with low_memory=False to disable low memory mode."
      )
      with pytest.raises(NotImplementedError, match=msg):
          est_low.predict_cumulative_hazard_function(X_test)
  
      msg = (
          "predict_survival_function is not implemented in low memory mode."
          " run fit with low_memory=False to disable low memory mode."
      )
      with pytest.raises(NotImplementedError, match=msg):
          est_low.predict_survival_function(X_test)
  
imports: import numpy
  from numpy.testing import assert_array_almost_equal, assert_array_equal
  import pytest
  from scipy import sparse
  from sklearn.model_selection import train_test_split
  from sklearn.pipeline import make_pipeline
  from sksurv.datasets import load_breast_cancer
  from sksurv.ensemble import ExtraSurvivalTrees, RandomSurvivalForest
  from sksurv.preprocessing import OneHotEncoder
  from sksurv.testing import assert_chf_properties, assert_cindex_almost_equal, assert_survival_function_properties
  from sksurv.tree import SurvivalTree
label_desc: Use image node_id 17 for calling a global function with example usage: test_predict_low_memory(make_whas500, est_cls, params) without return types