Пример #1
0
# Instead of the actual number of components here we pass a float value
# between 0 and 1 to select n_components based on the percentage of
# variance explained by the PCA components.

ica = ICA(n_components=0.90,
          n_pca_components=None,
          max_pca_components=None,
          random_state=0)

# Also we decide to use all PCA components before mixing back to sensor space.
# You can again use percentages (float) or set the total number of components
# to be kept directly (int) which allows to control the amount of additional
# denoising.

ica.n_pca_components = 1.0

# decompose sources for raw data using each third sample.
ica.decompose_raw(raw, picks=picks, decim=3)
print(ica)

# plot reasonable time window for inspection
start_plot, stop_plot = 100., 103.
ica.plot_sources_raw(raw, range(30), start=start_plot, stop=stop_plot)

###############################################################################
# Automatically find the ECG component using correlation with ECG signal.

# Defining a customized distance function.

# You can pass any function object that
Пример #2
0
###############################################################################
# Setup ICA seed decompose data, then access and plot sources.

# Instead of the actual number of components here we pass a float value
# between 0 and 1 to select n_components based on the percentage of
# variance explained by the PCA components.

ica = ICA(n_components=0.90, n_pca_components=None, max_pca_components=None,
          random_state=0)

# Also we decide to use all PCA components before mixing back to sensor space.
# You can again use percentages (float) or set the total number of components
# to be kept directly (int) which allows to control the amount of additional
# denoising.

ica.n_pca_components = 1.0

# decompose sources for raw data using each third sample.
ica.decompose_raw(raw, picks=picks, decim=3)
print(ica)

# plot reasonable time window for inspection
start_plot, stop_plot = 100., 103.
ica.plot_sources_raw(raw, range(30), start=start_plot, stop=stop_plot)

###############################################################################
# Automatically find the ECG component using correlation with ECG signal.

# Defining a customized distance function.

# You can pass any function object that