code: def test_alpha_array(rossi):
      cph = CoxPHSurvivalAnalysis(alpha=np.array([], dtype=float))
  
      with pytest.raises(
          ValueError,
          match=r"Length alphas \(0\) must match number of features \(7\)",
      ):
          cph.fit(rossi.x.values, rossi.y)
  
      alphas = np.empty(rossi.x.shape[1], dtype=str)
      alphas[:] = "failure"
      cph.set_params(alpha=alphas)
      with pytest.raises(
          ValueError,
          match="dtype='numeric' is not compatible with arrays of bytes/strings",
      ):
          cph.fit(rossi.x.values, rossi.y)
  
      alphas = np.random.randn(rossi.x.shape[1], 3, 4)
      cph.set_params(alpha=alphas)
      with pytest.raises(
          ValueError,
          match=r"Found array with dim 3\. CoxPHSurvivalAnalysis expected <= 2\.",
      ):
          cph.fit(rossi.x.values, rossi.y)
  
      alphas = np.ones(rossi.x.shape[1])
      alphas[-2] = -1e-4
      cph.set_params(alpha=alphas)
      with pytest.raises(
          ValueError, match=r"alpha must be positive, but was"
      ):
          cph.fit(rossi.x.values, rossi.y)
  
      cph.set_params(alpha=alphas[:-2])
      with pytest.raises(
          ValueError,
          match=r"Length alphas \(5\) must match number of features \(7\)",
      ):
          cph.fit(rossi.x.values, rossi.y)
  
imports: import warnings
  import numpy
  from numpy.testing import assert_array_almost_equal
  import pandas
  import pytest
  from scipy.optimize import check_grad
  from sklearn.exceptions import ConvergenceWarning
  from sklearn.pipeline import make_pipeline
  from sklearn.preprocessing import StandardScaler
  from sksurv.column import standardize
  from sksurv.datasets import load_breast_cancer
  from sksurv.linear_model.coxph import CoxPHOptimizer, CoxPHSurvivalAnalysis
  from sksurv.preprocessing import OneHotEncoder
label_desc: Use image node_id 12 for calling the TestCoxPH obj's underlying member method code with example usage: obj.test_alpha_array(rossi) without return types