Skip to content

Commit b16611a

Browse files
authored
MAINT: Update for sklearn deprecation (mne-tools#13545)
1 parent f4853ce commit b16611a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

examples/decoding/decoding_xdawn_eeg.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
from mne import Epochs, io, pick_types, read_events
3131
from mne.datasets import sample
3232
from mne.decoding import Vectorizer, XdawnTransformer, get_spatial_filter_from_estimator
33+
from mne.utils import check_version
3334

3435
print(__doc__)
3536

@@ -70,11 +71,16 @@
7071
)
7172

7273
# Create classification pipeline
74+
kwargs = dict()
75+
if check_version("sklearn", "1.8"):
76+
kwargs["l1_ratio"] = 1
77+
else:
78+
kwargs["penalty"] = "l1"
7379
clf = make_pipeline(
7480
XdawnTransformer(n_components=n_filter),
7581
Vectorizer(),
7682
MinMaxScaler(),
77-
OneVsRestClassifier(LogisticRegression(penalty="l1", solver="liblinear")),
83+
OneVsRestClassifier(LogisticRegression(solver="liblinear", **kwargs)),
7884
)
7985

8086
# Get the data and labels

0 commit comments

Comments
 (0)