code: def test_pca_score3(setup):
      # Check that probabilistic PCA selects the right model
      n, p = 200, 3
      rng = np.random.RandomState(0)
      Xl = mt.tensor(
          rng.randn(n, p)
          + rng.randn(n, 1) * np.array([3, 4, 5])
          + np.array([1, 0, 7])
      )
      Xt = mt.tensor(
          rng.randn(n, p)
          + rng.randn(n, 1) * np.array([3, 4, 5])
          + np.array([1, 0, 7])
      )
      ll = mt.zeros(p)
      for k in range(p):
          pca = PCA(n_components=k, svd_solver="full")
          pca.fit(Xl)
          ll[k] = pca.score(Xt)
  
      assert ll.argmax().to_numpy() == 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 21 for calling a global function with example usage: test_pca_score3(setup) without return types