There was an error while loading. Please reload this page.
1 parent 504fa11 commit f907908Copy full SHA for f907908
34 files changed
examples/datasets/spm_faces_dataset.py
@@ -36,7 +36,7 @@
36
raw.resample(100)
37
raw.filter(1.0, None) # high-pass
38
reject = dict(mag=5e-12)
39
-ica = ICA(n_components=0.95, max_iter="auto", random_state=0)
+ica = ICA(n_components=0.95, max_iter="auto", rng=0)
40
ica.fit(raw, reject=reject)
41
# compute correlation scores, get bad indices sorted by score
42
eog_epochs = create_eog_epochs(raw, ch_name="MRT31-2908", reject=reject)
examples/inverse/mixed_norm_inverse.py
@@ -81,7 +81,7 @@
81
return_residual=True,
82
return_as_dipoles=True,
83
verbose=True,
84
- random_state=0,
+ rng=0,
85
# for this dataset we know we should use a high alpha, so avoid some
86
# of the slower (lower) alpha values
87
sure_alpha_grid=np.linspace(100, 40, 10),
examples/preprocessing/find_ref_artifacts.py
@@ -77,7 +77,7 @@
77
ica_kwargs = dict(
78
method="picard",
79
fit_params=dict(tol=1e-4), # use a high tol here for speed
80
- random_state=99,
+ rng=99,
)
all_picks = mne.pick_types(raw_tog.info, meg=True, ref_meg=True)
ica_tog = ICA(n_components=60, max_iter="auto", allow_ref_meg=True, **ica_kwargs)
examples/preprocessing/ica_comparison.py
@@ -50,7 +50,7 @@ def run_ica(method, fit_params=None):
50
method=method,
51
fit_params=fit_params,
52
max_iter="auto",
53
54
55
t0 = time()
56
examples/preprocessing/muscle_ica.py
@@ -37,9 +37,7 @@
# %%
# Run ICA
-ica = mne.preprocessing.ICA(
- n_components=15, method="picard", max_iter="auto", random_state=97
-)
+ica = mne.preprocessing.ICA(n_components=15, method="picard", max_iter="auto", rng=97)
43
ica.fit(raw)
44
45
@@ -104,7 +102,7 @@
104
102
105
103
106
ica = mne.preprocessing.ICA(
107
+ n_components=15, method="picard", max_iter="auto", rng=97
108
109
110
ica.plot_sources(raw)
examples/simulation/plot_stc_metrics.py
@@ -76,7 +76,7 @@
76
location=location,
extent=extent,
subjects_dir=subjects_dir,
- random_state=random_state,
+ rng=random_state,
# Dipole
@@ -88,7 +88,7 @@
88
89
90
91
92
93
94
# WHAT?
@@ -128,15 +128,15 @@
128
raw_region = raw_region.pick(picks=["eeg", "stim"], exclude="bads")
129
cov = mne.make_ad_hoc_cov(raw_region.info)
130
mne.simulation.add_noise(
131
- raw_region, cov, iir_filter=[0.2, -0.2, 0.04], random_state=random_state
+ raw_region, cov, iir_filter=[0.2, -0.2, 0.04], rng=random_state
132
133
134
135
raw_dipole = mne.simulation.simulate_raw(info, source_simulator_dipole, forward=fwd)
136
raw_dipole = raw_dipole.pick(picks=["eeg", "stim"], exclude="bads")
137
cov = mne.make_ad_hoc_cov(raw_dipole.info)
138
139
- raw_dipole, cov, iir_filter=[0.2, -0.2, 0.04], random_state=random_state
+ raw_dipole, cov, iir_filter=[0.2, -0.2, 0.04], rng=random_state
140
141
142
###############################################################################
examples/simulation/simulate_evoked_data.py
@@ -67,7 +67,7 @@ def data_fun(times):
67
fwd["src"],
68
n_dipoles=2,
69
times=times,
70
- random_state=42,
+ rng=42,
71
labels=labels,
72
data_fun=data_fun,
73
examples/simulation/simulate_raw_data.py
fwd = mne.read_forward_solution(fwd_fname)
src = fwd["src"]
stc = simulate_sparse_stc(
- src, n_dipoles=n_dipoles, times=times, data_fun=data_fun, random_state=rng
+ src, n_dipoles=n_dipoles, times=times, data_fun=data_fun, rng=rng
# look at our source data
fig, ax = plt.subplots(1)
@@ -79,9 +79,9 @@ def data_fun(times):
# Simulate raw data
raw_sim = simulate_raw(raw.info, [stc] * 10, forward=fwd, verbose=True)
cov = make_ad_hoc_cov(raw_sim.info)
-add_noise(raw_sim, cov, iir_filter=[0.2, -0.2, 0.04], random_state=rng)
-add_ecg(raw_sim, random_state=rng)
-add_eog(raw_sim, random_state=rng)
+add_noise(raw_sim, cov, iir_filter=[0.2, -0.2, 0.04], rng=rng)
+add_ecg(raw_sim, rng=rng)
+add_eog(raw_sim, rng=rng)
raw_sim.plot()
##############################################################################
examples/simulation/simulated_raw_data_using_subject_anatomy.py
@@ -204,9 +204,9 @@ def data_fun(times, latency, duration):
204
raw_sim = mne.simulation.simulate_raw(info, source_simulator, forward=fwd)
205
raw_sim.set_eeg_reference(projection=True)
206
207
-mne.simulation.add_noise(raw_sim, cov=noise_cov, random_state=0)
208
-mne.simulation.add_eog(raw_sim, random_state=0)
209
-mne.simulation.add_ecg(raw_sim, random_state=0)
+mne.simulation.add_noise(raw_sim, cov=noise_cov, rng=0)
+mne.simulation.add_eog(raw_sim, rng=0)
+mne.simulation.add_ecg(raw_sim, rng=0)
210
211
# Plot original and simulated raw data.
212
raw_sim.plot(title="Simulated raw data")
examples/simulation/source_simulator.py
@@ -85,7 +85,7 @@ class to generate source estimates and raw data. It is meant to be a brief
# simulator can be given directly to the simulate_raw function.
raw = mne.simulation.simulate_raw(info, source_simulator, forward=fwd)
cov = mne.make_ad_hoc_cov(raw.info)
-mne.simulation.add_noise(raw, cov, iir_filter=[0.2, -0.2, 0.04], random_state=97)
+mne.simulation.add_noise(raw, cov, iir_filter=[0.2, -0.2, 0.04], rng=97)
raw.plot()
0 commit comments