code: def test_randomized_pca_check_projection(setup):
      # Test that the projection by randomized PCA on dense data is correct
      rng = np.random.RandomState(0)
      n, p = 100, 3
      X = mt.tensor(rng.randn(n, p) * 0.1)
      X[:10] += mt.array([3, 4, 5])
      Xt = 0.1 * mt.tensor(rng.randn(1, p)) + mt.array([3, 4, 5])
  
      Yt = (
          PCA(n_components=2, svd_solver="randomized", random_state=0)
          .fit(X)
          .transform(Xt)
      )
      Yt /= np.sqrt((Yt**2).sum())
  
      assert_almost_equal(mt.abs(Yt[0][0]).to_numpy(), 1.0, 1)
  
imports: from itertools import product
  import numpy
  import pytest
  import scipy
  from sklearn import datasets
  from sklearn.utils._testing import assert_array_almost_equal, assert_almost_equal, assert_raises_regex, assert_raise_message, assert_raises
  from ....None import tensor
  from .._pca import PCA, _assess_dimension, _infer_dimension
label_desc: Use image node_id 10 for calling a global function with example usage: test_randomized_pca_check_projection(setup) without return types