-
-
Notifications
You must be signed in to change notification settings - Fork 26.2k
Closed
Description
I noticed this in 0.12.1 but it appears to be unchanged in the current code. The documentation for RandomizedLasso says that precompute can be True, False, or 'auto'. However, when I tried to explicitly pass False, I got an exception.
The reason is because the value for precompute is passed straight into lars_path as the value for Gram, which takes a different set of values (None, 'auto', a matrix or a shape). So there's an exception when lars_path assumes it has a matrix.
Example demonstrating the error:
import numpy as np
from sklearn.linear_model import RandomizedLasso
X = np.random.standard_normal(size=(25,500))
y = np.random.standard_normal(25)
clf = RandomizedLasso(precompute=False).fit(X, y)
I'm not sure what the interaction between RandomizedLasso, _randomized_lasso, and lars_path should be. Presumably the interface to lars_path should not change, so the fix should be to pass None instead of False when it gets called.