@requires_sklearn
def test_ica_twice():
 raw = read_raw_fif(raw_fname).crop(1.5, stop).load_data()
 picks = pick_types(raw.info, meg='grad', exclude='bads')
 n_components = 0.9
 max_pca_components = None
 n_pca_components = 1.1
 with warnings.catch_warnings(record=True):
  ica1 = ICA(n_components=n_components, max_pca_components=max_pca_components, n_pca_components=n_pca_components, random_state=0)
  ica1.fit(raw, picks=picks, decim=3)
  raw_new = ica1.apply(raw, n_pca_components=n_pca_components)
  ica2 = ICA(n_components=n_components, max_pca_components=max_pca_components, n_pca_components=1.0, random_state=0)
  ica2.fit(raw_new, picks=picks, decim=3)
  assert_equal(ica1.n_components_, ica2.n_components_)

@ requires_sklearn def test_ica_twice ( ) : raw = read_raw_fif ( raw_fname ) . crop ( 1.5 , stop ) . load_data ( ) picks = pick_types ( raw . info , meg = 'grad' , exclude = 'bads' ) n_components = 0.9 max_pca_components = None n_pca_components = 1.1 with warnings . catch_warnings ( record = True ) : ica1 = ICA ( n_components = n_components , max_pca_components = max_pca_components , n_pca_components = n_pca_components , random_state = 0 ) ica1 . fit ( raw , picks = picks , decim = 3 ) raw_new = ica1 . apply ( raw , n_pca_components = n_pca_components ) ica2 = ICA ( n_components = n_components , max_pca_components = max_pca_components , n_pca_components = 1.0 , random_state = 0 ) ica2 . fit ( raw_new , picks = picks , decim = 3 ) assert_equal ( ica1 . n_components_ , ica2 . n_components_ )
test running ica twice .