@@ -543,16 +543,17 @@ def rmatvec(b):
543
543
for j in range (y .shape [1 ]))
544
544
self .coef_ = np .vstack ([out [0 ] for out in outs ])
545
545
self ._residues = np .vstack ([out [3 ] for out in outs ])
546
- elif X .shape [1 ] <= 2 and np .all (np .linalg .eigvals (np .dot (X , np .transpose (X ))) > 0 ):
546
+ elif (X .shape [1 ] <= 2
547
+ and np .all (np .linalg .eigvals (np .dot (X , np .transpose (X ))) > 0 )):
547
548
n_samples , n_features = X .shape
548
549
if y .ndim == 1 :
549
550
y = y .reshape (- 1 , 1 )
550
551
n_samples_ , n_targets = y .shape
551
552
alpha = np .asarray (0 , dtype = X .dtype ).ravel ()
552
553
if alpha .size not in [1 , n_targets ]:
553
- raise ValueError ("Number of targets and number of penalties "
554
- "do not correspond: %d != %d"
555
- % (alpha .size , n_targets ))
554
+ raise ValueError ("Number of targets and number of penalties"
555
+ "do not correspond: %d != %d"
556
+ % (alpha .size , n_targets ))
556
557
557
558
if alpha .size == 1 and n_targets > 1 :
558
559
alpha = np .repeat (alpha , n_targets )
@@ -562,7 +563,8 @@ def rmatvec(b):
562
563
try :
563
564
dual_coef = _solve_cholesky_kernel (K , y , alpha )
564
565
565
- self .coef_ = safe_sparse_dot (X .T , dual_coef , dense_output = True ).T
566
+ self .coef_ = safe_sparse_dot (X .T , dual_coef ,
567
+ dense_output = True ).T
566
568
except linalg .LinAlgError :
567
569
# use SVD solver if matrix is singular
568
570
self .coef_ = _solve_svd (X , y , alpha )
0 commit comments