code: def test_incremental_pca_validation():
      # Test that n_components is <= n_features.
      X = np.array([[0, 1, 0], [1, 0, 0]])
      n_samples, n_features = X.shape
      n_components = 4
      with pytest.raises(
          ValueError,
          match=(
              "n_components={} invalid"
              " for n_features={}, need more rows than"
              " columns for IncrementalPCA"
              " processing".format(n_components, n_features)
          ),
      ):
          IncrementalPCA(n_components, batch_size=10).fit(X)
  
      # Tests that n_components is also <= n_samples.
      n_components = 3
      with pytest.raises(
          ValueError,
          match=(
              "n_components={} must be"
              " less or equal to the batch number of"
              " samples {}".format(n_components, n_samples)
          ),
      ):
          IncrementalPCA(n_components=n_components).partial_fit(X)
  
imports: import warnings
  import numpy
  import pytest
  from numpy.testing import assert_array_equal
  from sklearn import datasets
  from sklearn.decomposition import PCA, IncrementalPCA
  from sklearn.utils._testing import assert_allclose_dense_sparse, assert_almost_equal, assert_array_almost_equal
  from sklearn.utils.fixes import CSC_CONTAINERS, CSR_CONTAINERS, LIL_CONTAINERS
label_desc: Use image node_id 5 for calling a global function with example usage: test_incremental_pca_validation() without return types