10000 Style improvements to least_angle.py (#11703) · scikit-learn/scikit-learn@7ba7a4a · GitHub
[go: up one dir, main page]

Skip to content

Commit 7ba7a4a

Browse files
yukuairoyagramfort
authored andcommitted
Style improvements to least_angle.py (#11703)
1 parent e79fe95 commit 7ba7a4a

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

sklearn/linear_model/least_angle.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,8 @@ def __init__(self, fit_intercept=True, verbose=False, normalize=True,
606606
self.copy_X = copy_X
607607
self.fit_path = fit_path
608608

609-
def _get_gram(self, precompute, X, y):
609+
@staticmethod
610+
def _get_gram(precompute, X, y):
610611
if (not hasattr(precompute, '__array__')) and (
611612
(precompute is True) or
612613
(precompute == 'auto' and X.shape[0] > X.shape[1]) or

sklearn/linear_model/tests/test_least_angle.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ def test_simple_precomputed():
8080

8181
def test_all_precomputed():
8282
# Test that lars_path with precomputed Gram and Xy gives the right answer
83-
X, y = diabetes.data, diabetes.target
8483
G = np.dot(X.T, X)
8584
Xy = np.dot(X.T, y)
8685
for method in 'lar', 'lasso':
@@ -188,7 +187,6 @@ def test_no_path_all_precomputed():
188187
[linear_model.Lars, linear_model.LarsCV, linear_model.LassoLarsIC])
189188
def test_lars_precompute(classifier):
190189
# Check for different values of precompute
191-
X, y = diabetes.data, diabetes.target
192190
G = np.dot(X.T, X)
193191

194192
clf = classifier(precompute=G)

0 commit comments

Comments
 (0)
0