code: def test_incremental_pca(svd_solver):
      # Incremental PCA on dense arrays.
      X = iris.data
      X = da.from_array(X, chunks=(3, -1))
      batch_size = X.shape[0] // 3
      ipca = IncrementalPCA(
          n_components=2, batch_size=batch_size, svd_solver=svd_solver
      )
      pca = PCA(n_components=2, svd_solver=svd_solver)
      pca.fit_transform(X.compute())
  
      X_transformed = ipca.fit_transform(X)
  
      assert X_transformed.shape == (X.shape[0], 2)
      np.testing.assert_allclose(
          ipca.explained_variance_ratio_.sum(),
          pca.explained_variance_ratio_.sum(),
          rtol=1e-3,
      )
  
      for n_components in [1, 2, X.shape[1]]:
          ipca = IncrementalPCA(n_components, batch_size=batch_size)
          ipca.fit(X)
          cov = ipca.get_covariance()
          precision = ipca.get_precision()
          np.testing.assert_allclose(
              np.dot(cov, precision), np.eye(X.shape[1]), atol=1e-13
          )
  
          assert isinstance(
              pca.singular_values_, type(ipca.singular_values_)
          )
          assert isinstance(pca.mean_, type(ipca.mean_))
          assert isinstance(
              pca.explained_variance_, type(ipca.explained_variance_)
          )
          assert isinstance(
              pca.explained_variance_ratio_,
              type(ipca.explained_variance_ratio_),
          )
  
imports: import numpy
  import pytest
  from dask import array
  from sklearn import datasets, decomposition
  from sklearn.decomposition import PCA
  from dask_ml.decomposition import IncrementalPCA
  from dask_ml.utils import flip_vector_signs
label_desc: Use image node_id 2 for calling a global function with example usage: test_incremental_pca(svd_solver) without return types