code: def test_incremental_pca_set_params():
      # Test that components_ sign is stable over batch sizes.
      rng = np.random.RandomState(1999)
      n_samples = 100
      n_features = 20
      X = rng.randn(n_samples, n_features)
      X2 = rng.randn(n_samples, n_features)
      X3 = rng.randn(n_samples, n_features)
      X = da.from_array(X, chunks=[4, -1])
      X2 = da.from_array(X2, chunks=[4, -1])
      X3 = da.from_array(X3, chunks=[4, -1])
  
      ipca = IncrementalPCA(n_components=20)
      ipca.fit(X)
      # Decreasing number of components
      ipca.set_params(n_components=10)
      with pytest.raises(ValueError):
          ipca.partial_fit(X2)
      # Increasing number of components
      ipca.set_params(n_components=15)
      with pytest.raises(ValueError):
          ipca.partial_fit(X3)
      # Returning to original setting
      ipca.set_params(n_components=20)
      ipca.partial_fit(X)
  
imports: import numpy
  import pytest
  from dask import array
  from sklearn import datasets, decomposition
  from sklearn.decomposition import PCA
  from dask_ml.decomposition import IncrementalPCA
  from dask_ml.utils import flip_vector_signs
label_desc: Use image node_id 7 for calling a global function with example usage: test_incremental_pca_set_params() without return types