Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Style improvements to least_angle.py #11703

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

Merged
merged 8 commits into from
Aug 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion sklearn/linear_model/least_angle.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,8 @@ def __init__(self, fit_intercept=True, verbose=False, normalize=True,
self.copy_X = copy_X
self.fit_path = fit_path

def _get_gram(self, precompute, X, y):
@staticmethod
def _get_gram(precompute, X, y):
Copy link
Member

Choose a reason for hiding this comment

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

ok with this change.

if (not hasattr(precompute, '__array__')) and (
(precompute is True) or
(precompute == 'auto' and X.shape[0] > X.shape[1]) or
Expand Down
2 changes: 0 additions & 2 deletions sklearn/linear_model/tests/test_least_angle.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ def test_simple_precomputed():

def test_all_precomputed():
# Test that lars_path with precomputed Gram and Xy gives the right answer
X, y = diabetes.data, diabetes.target
G = np.dot(X.T, X)
Xy = np.dot(X.T, y)
for method in 'lar', 'lasso':
Expand Down Expand Up @@ -188,7 +187,6 @@ def test_no_path_all_precomputed():
[linear_model.Lars, linear_model.LarsCV, linear_model.LassoLarsIC])
def test_lars_precompute(classifier):
# Check for different values of precompute
X, y = diabetes.data, diabetes.target
G = np.dot(X.T, X)

clf = classifier(precompute=G)
Expand Down