code: def test_kernel_pca_solvers_equivalence(n_components):
      """Check that 'dense' 'arpack' & 'randomized' solvers give similar results"""
  
      # Generate random data
      n_train, n_test = 1_000, 100
      X, _ = make_circles(
          n_samples=(n_train + n_test),
          factor=0.3,
          noise=0.05,
          random_state=0,
      )
      X_fit, X_pred = X[:n_train, :], X[n_train:, :]
  
      # reference (full)
      ref_pred = (
          KernelPCA(n_components, eigen_solver="dense", random_state=0)
          .fit(X_fit)
          .transform(X_pred)
      )
  
      # arpack
      a_pred = (
          KernelPCA(n_components, eigen_solver="arpack", random_state=0)
          .fit(X_fit)
          .transform(X_pred)
      )
      # check that the result is still correct despite the approx
      assert_array_almost_equal(np.abs(a_pred), np.abs(ref_pred))
  
      # randomized
      r_pred = (
          KernelPCA(
              n_components, eigen_solver="randomized", random_state=0
          )
          .fit(X_fit)
          .transform(X_pred)
      )
      # check that the result is still correct despite the approximation
      assert_array_almost_equal(np.abs(r_pred), np.abs(ref_pred))
  
imports: import warnings
  import numpy
  import pytest
  import sklearn
  from sklearn.datasets import load_iris, make_blobs, make_circles
  from sklearn.decomposition import PCA, KernelPCA
  from sklearn.exceptions import NotFittedError
  from sklearn.linear_model import Perceptron
  from sklearn.metrics.pairwise import rbf_kernel
  from sklearn.model_selection import GridSearchCV
  from sklearn.pipeline import Pipeline
  from sklearn.preprocessing import StandardScaler
  from sklearn.utils._testing import assert_allclose, assert_array_almost_equal, assert_array_equal
  from sklearn.utils.fixes import CSR_CONTAINERS
  from sklearn.utils.validation import _check_psd_eigenvalues
label_desc: Use image node_id 17 for calling a global function with example usage: test_kernel_pca_solvers_equivalence(n_components) without return types