code: def test_optimized_rand_covariance():
      """Tests CP_PLSR captures covariance between random, unrelated x and y"""
      x = tl.tensor(np.random.rand(80, 60, 50, 40))
      y = tl.tensor(np.random.rand(80))
  
      pls = CP_PLSR(3)
      pls.fit(x, y)
      y = tl.tensor_to_vec(y)
  
      for component in range(3):
          assert (
              np.corrcoef(pls.X_factors[0][:, component], y)[0, 1] > 0.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 11 for calling a global function with example usage: test_optimized_rand_covariance() without return types