Skip to content

Commit bd3a02f

Browse files
committed
revert autoformatter changes
1 parent cdc7768 commit bd3a02f

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

skglm/datafits/single_task.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,7 @@ def gradient_scalar(self, X, y, w, Xw, j):
211211
def gradient_scalar_sparse(self, X_data, X_indptr, X_indices, y, Xw, j):
212212
XjTXw = 0.
213213
for i in range(X_indptr[j], X_indptr[j + 1]):
214-
XjTXw += X_data[i] * \
215-
self.sample_weights[X_indices[i]] * Xw[X_indices[i]]
214+
XjTXw += X_data[i] * self.sample_weights[X_indices[i]] * Xw[X_indices[i]]
216215
return (XjTXw - self.Xty[j]) / self.sample_weights.sum()
217216

218217
def gradient(self, X, y, Xw):

skglm/estimators.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -601,8 +601,7 @@ def fit(self, X, y):
601601
Fitted estimator.
602602
"""
603603
if self.weights is None:
604-
warnings.warn(
605-
'Weights are not provided, fitting with Lasso penalty')
604+
warnings.warn('Weights are not provided, fitting with Lasso penalty')
606605
penalty = L1(self.alpha, self.positive)
607606
else:
608607
penalty = WeightedL1(self.alpha, self.weights, self.positive)
@@ -735,8 +734,7 @@ def path(self, X, y, alphas, coef_init=None, return_n_iter=True, **params):
735734
The number of iterations along the path. If return_n_iter is set to
736735
``True``.
737736
"""
738-
penalty = compiled_clone(L1_plus_L2(
739-
self.alpha, self.l1_ratio, self.positive))
737+
penalty = compiled_clone(L1_plus_L2(self.alpha, self.l1_ratio, self.positive))
740738
datafit = compiled_clone(Quadratic(), to_float32=X.dtype == np.float32)
741739
solver = AndersonCD(
742740
self.max_iter, self.max_epochs, self.p0, tol=self.tol,
@@ -1324,8 +1322,7 @@ def fit(self, X, y):
13241322
f"two columns. Got one column.\nAssuming that `y` "
13251323
"is the vector of times and there is no censoring."
13261324
)
1327-
y = np.column_stack((y, np.ones_like(y))).astype(
1328-
X.dtype, order="F")
1325+
y = np.column_stack((y, np.ones_like(y))).astype(X.dtype, order="F")
13291326
elif y.shape[1] > 2:
13301327
raise ValueError(
13311328
f"{repr(self)} requires the vector of response `y` to have "
@@ -1543,8 +1540,7 @@ def path(self, X, Y, alphas, coef_init=None, return_n_iter=False, **params):
15431540
The number of iterations along the path. If return_n_iter is set to
15441541
``True``.
15451542
"""
1546-
datafit = compiled_clone(QuadraticMultiTask(),
1547-
to_float32=X.dtype == np.float32)
1543+
datafit = compiled_clone(QuadraticMultiTask(), to_float32=X.dtype == np.float32)
15481544
penalty = compiled_clone(L2_1(self.alpha))
15491545
solver = MultiTaskBCD(
15501546
self.max_iter, self.max_epochs, self.p0, tol=self.tol,

0 commit comments

Comments
 (0)