code: def test_prediction_cache(self) -> None:
      X, y = tm.make_sparse_regression(512, 4, 0.5, as_dense=False)
      Xy = xgb.DMatrix(X, y)
      param = {"max_depth": 8}
      booster = xgb.train(param, Xy, num_boost_round=1)
      with tempfile.TemporaryDirectory() as tmpdir:
          path = os.path.join(tmpdir, "model.json")
          booster.save_model(path)
  
          predt_0 = booster.predict(Xy)
  
          param["max_depth"] = 2
  
          booster = xgb.train(param, Xy, num_boost_round=1)
          predt_1 = booster.predict(Xy)
          assert not np.isclose(predt_0, predt_1).all()
  
          booster.load_model(path)
          predt_2 = booster.predict(Xy)
          np.testing.assert_allclose(predt_0, predt_2)
  
imports: import json
  import os
  import tempfile
  import numpy
  import pytest
  import xgboost
  from xgboost import testing
  from xgboost.testing.updater import ResetStrategy
label_desc: Use image node_id 10 for calling the TestModels obj's underlying member method code with example usage: obj.test_prediction_cache() without return types