code: def test_pca_value_errors():
      with pytest.raises(ValueError) as err:
          PCA(n_components=0)
      assert str(err.value) == "n_components must be at least 1"
  
      with pytest.raises(ValueError) as err:
          pca = PCA(n_components=4)
          pca.fit(np.random.randn(100, 3))
      assert (
          str(err.value)
          == "n_components must be less than the number of features."
      )
  
      with pytest.raises(ValueError) as err:
          pca = PCA(n_components=10, kernel=GaussianRBF())
          pca.fit(np.random.randn(9, 3))
      assert (
          str(err.value)
          == "n_components must be less than the number of reference instances."
      )
  
file_path: alibi-detect/alibi_detect/od/tests/test__pca/test__pca.py
imports: import pytest
  import numpy
  import torch
  from alibi_detect.utils.pytorch.kernels import GaussianRBF
  from alibi_detect.od._pca import PCA
  from alibi_detect.exceptions import NotFittedError
  from sklearn.datasets import make_moons
label_desc: Use image node_id 3 for calling a global function with example usage: test_pca_value_errors() without return types