code: def test_transform(n_modes, n_response):
      """Tests transform() returns first X_factor--relationship between first
      tensor mode and components.
      """
      x, y, _, _ = _get_pls_dataset(
          tuple([10] * n_modes), N_LATENT, n_response
      )
      pls = CP_PLSR(N_LATENT)
      pls.fit(x, y)
  
      transformed = pls.transform(x)
      assert_allclose(transformed, pls.X_factors[0])
  
imports: import numpy
  import pytest
  import tensorly
  from ...testing import assert_allclose
  from ...cp_tensor import CPTensor, cp_normalize, cp_to_tensor
  from ...metrics.factors import congruence_coefficient
  from ...random import random_cp
  from ..cp_plsr import CP_PLSR
label_desc: Use image node_id 3 for calling a global function with example usage: test_transform(n_modes, n_response) without return types