Skip to content

Commit 6bbc459

Browse files
committed
clean up _xdawn_estimate
1 parent 25e1ae3 commit 6bbc459

1 file changed

Lines changed: 5 additions & 23 deletions

File tree

mne/decoding/_covs_ged.py

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -115,17 +115,9 @@ def _xdawn_estimate(
115115
reg,
116116
cov_method_params,
117117
R=None,
118-
events=None,
119-
tmin=0,
120-
sfreq=1,
121118
info=None,
122119
rank="full",
123120
):
124-
from ..preprocessing.xdawn import _least_square_evoked
125-
126-
if not isinstance(X, np.ndarray) or X.ndim != 3:
127-
raise ValueError("X must be 3D ndarray")
128-
129121
classes = np.unique(y)
130122

131123
# XXX Eventually this could be made to deal with rank deficiency properly
@@ -140,23 +132,13 @@ def _xdawn_estimate(
140132
)
141133
elif isinstance(R, Covariance):
142134
R = R.data
143-
if not isinstance(R, np.ndarray) or (
144-
not np.array_equal(R.shape, np.tile(X.shape[1], 2))
145-
):
146-
raise ValueError(
147-
"R must be None, a covariance instance, "
148-
"or an array of shape (n_chans, n_chans)"
149-
)
150135

151136
# Get prototype events
152-
if events is not None:
153-
evokeds, toeplitzs = _least_square_evoked(X, events, tmin, sfreq)
154-
else:
155-
evokeds, toeplitzs = list(), list()
156-
for c in classes:
157-
# Prototyped response for each class
158-
evokeds.append(np.mean(X[y == c, :, :], axis=0))
159-
toeplitzs.append(1.0)
137+
evokeds, toeplitzs = list(), list()
138+
for c in classes:
139+
# Prototyped response for each class
140+
evokeds.append(np.mean(X[y == c, :, :], axis=0))
141+
toeplitzs.append(1.0)
160142

161143
covs = []
162144
for evo, toeplitz in zip(evokeds, toeplitzs):

0 commit comments

Comments
 (0)