docstr: test if prediction for last stage equals ``predict``
docstr_tok: ["test","if","prediction","for","last","stage","equals","``","predict","``"]
code: def assert_staged_predict(self, model, X):
      """test if prediction for last stage equals ``predict``"""
      y_pred = model.predict(X)
  
      # test if prediction for last stage equals ``predict``
      y_staged = None
      for y_staged in model.staged_predict(X):
          assert y_staged.shape == y_pred.shape
  
      assert_array_equal(y_pred, y_staged)
  
imports: from contextlib import nullcontext
  from os.path import dirname, join
  import numpy
  from numpy.testing import assert_array_almost_equal, assert_array_equal
  import pandas
  import pytest
  from sklearn.metrics import mean_squared_error
  from sksurv.column import categorical_to_numeric, standardize
  from sksurv.datasets import load_whas500
  from sksurv.ensemble import ComponentwiseGradientBoostingSurvivalAnalysis, GradientBoostingSurvivalAnalysis
  from sksurv.testing import FixtureParameterFactory, assert_cindex_almost_equal
  from sksurv.util import Surv
label_desc: Use image node_id 17 for calling the TestGradientBoosting obj's underlying member method code with example usage: obj.assert_staged_predict(model, X) without return types