code: def test_randomized_pca_inverse():
      # Test that randomized PCA is inversible on dense data
      rng = np.random.RandomState(0)
      n, p = 50, 3
      X = rng.randn(n, p)  # spherical data
      X[:, 1] *= 0.00001  # make middle component relatively small
      X += [5, 4, 3]  # make a large mean
      dX = da.from_array(X, chunks=(n, p))
  
      # same check that we can find the original data from the transformed signal
      # (since the data is almost of rank n_components)
      pca = dd.PCA(
          n_components=2, svd_solver="randomized", random_state=0
      ).fit(dX)
      Y = pca.transform(X)
      Y_inverse = pca.inverse_transform(Y)
      assert_almost_equal(X, Y_inverse, decimal=2)
  
      # same as above with whitening (approximate reconstruction)
      pca = dd.PCA(
          n_components=2,
          whiten=True,
          svd_solver="randomized",
          random_state=0,
      ).fit(dX)
      Y = pca.transform(X)
      Y_inverse = pca.inverse_transform(Y)
      relative_max_delta = (
          np.abs(X - Y_inverse) / np.abs(X).mean()
      ).max()
      assert relative_max_delta < 1e-5
  
imports: from itertools import product
  import dask.array
  import dask.dataframe
  import numpy
  import pandas
  import pytest
  import scipy
  import sklearn.decomposition
  from dask.array.utils import assert_eq
  from numpy.testing import assert_almost_equal, assert_array_almost_equal, assert_raises
  from sklearn import datasets
  from sklearn.utils import check_random_state
  import dask_ml.decomposition
  from dask_ml._compat import DASK_2_26_0
  from dask_ml.utils import assert_estimator_equal, flip_vector_signs, svd_flip
label_desc: Use image node_id 15 for calling a global function with example usage: test_randomized_pca_inverse() without return types