Skip to content

Commit fd2e3d2

Browse files
larsoneragramfort
authored andcommitted
MRG: Fix for sklearn (#5814)
* FIX: Fix for sklearn * fix?
1 parent 1532f98 commit fd2e3d2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

mne/inverse_sparse/mxne_optim.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,10 @@ def _mixed_norm_solver_cd(M, G, alpha, lipschitz_constant, maxit=10000,
302302
clf = MultiTaskLasso(alpha=alpha / len(M), tol=tol / sum_squared(M),
303303
normalize=False, fit_intercept=False, max_iter=maxit,
304304
warm_start=True)
305-
clf.coef_ = init.T if init is not None else init
305+
if init is not None:
306+
clf.coef_ = init.T
307+
else:
308+
clf.coef_ = np.zeros((G.shape[1], M.shape[1])).T
306309
clf.fit(G, M)
307310

308311
X = clf.coef_.T

0 commit comments

Comments
 (0)