Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MAINT] deal with new warnings related to sklearn 1.3 #3801

Merged
merged 10 commits into from
Jul 5, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 3 additions & 5 deletions examples/02_decoding/plot_miyawaki_encoding.py
Remi-Gau marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,9 @@
for train, test in cv.split(X=stimuli):
# we train the Ridge estimator on the training set
# and predict the fMRI activity for the test set
predictions = (
Ridge(alpha=100.0)
.fit(stimuli.reshape(-1, 100)[train], fmri_data[train])
.predict(stimuli.reshape(-1, 100)[test])
)
predictions = estimator.fit(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

estimator is defined above but was not used in this file

stimuli.reshape(-1, 100)[train], fmri_data[train]
).predict(stimuli.reshape(-1, 100)[test])
# we compute how much variance our encoding model explains in each voxel
scores.append(
r2_score(fmri_data[test], predictions, multioutput="raw_values")
Expand Down
2 changes: 1 addition & 1 deletion examples/02_decoding/plot_miyawaki_reconstruction.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def flatten(list_of_2d_array):
[
("selection", SelectKBest(f_classif, k=500)),
("scl", StandardScaler()),
("clf", OMP(normalize=False, n_nonzero_coefs=10)),
("clf", OMP(normalize="deprecated", n_nonzero_coefs=10)),
Remi-Gau marked this conversation as resolved.
Show resolved Hide resolved
]
)
clf.fit(X_train, y_train[:, i])
Expand Down
4 changes: 2 additions & 2 deletions nilearn/decoding/decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@

SUPPORTED_ESTIMATORS = dict(
svc_l1=LinearSVC(penalty="l1", dual=False, max_iter=10000),
svc_l2=LinearSVC(penalty="l2", max_iter=10000),
svc=LinearSVC(penalty="l2", max_iter=10000),
svc_l2=LinearSVC(penalty="l2", dual=True, max_iter=10000),
Remi-Gau marked this conversation as resolved.
Show resolved Hide resolved
svc=LinearSVC(penalty="l2", dual=True, max_iter=10000),
logistic_l1=LogisticRegressionCV(penalty="l1", solver="liblinear"),
logistic_l2=LogisticRegressionCV(penalty="l2", solver="liblinear"),
logistic=LogisticRegressionCV(penalty="l2", solver="liblinear"),
Expand Down