code: def test_fit(make_whas500):
      whas500_data = make_whas500(with_std=False, to_numeric=True)
  
      model = ComponentwiseGradientBoostingSurvivalAnalysis(
          n_estimators=100
      )
      model.fit(whas500_data.x, whas500_data.y)
  
      assert model.loss == "coxph"
  
      p = model.predict(whas500_data.x)
  
      assert_cindex_almost_equal(
          whas500_data.y["fstat"],
          whas500_data.y["lenfol"],
          p,
          (0.7755659, 58283, 16866, 0, 14),
      )
  
      expected_coef = pd.Series(
          np.zeros(15, dtype=float), index=whas500_data.names
      )
      expected_coef["age"] = 0.040919
      expected_coef["hr"] = 0.004977
      expected_coef["diasbp"] = -0.003407
      expected_coef["bmi"] = -0.017938
      expected_coef["sho"] = 0.429904
      expected_coef["chf"] = 0.508211
  
      assert_array_almost_equal(expected_coef.values, model.coef_)
  
      assert (100,) == model.train_score_.shape
  
      with pytest.raises(
          ValueError,
          match="X has 2 features, but ComponentwiseGradientBoostingSurvivalAnalysis is "
          "expecting 14 features as input.",
      ):
          model.predict(whas500_data.x[:, :2])
  
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 1 for calling the TestComponentwiseGradientBoosting obj's underlying member method code with example usage: obj.test_fit(make_whas500) without return types