scikit-learn compatible implementation of stability selection.
BSD 3-Clause "New" or "Revised" License
210
stars
63
forks
source link
I get error:TypeError: __init__() got an unexpected keyword argument 'normalize' #39
Closed
TonyEinstein closed 1 year ago
This error occurred in: ` X_1 = df[['Open', 'High', 'Low', 'Close', 'Volume', 'ewm', 'H-L', 'O-C', '3day MA', '10day MA', '30day MA', 'Std_dev']] y_1 = df['Adj Close'] colnames = X_1.columns
lambda_grid = np.linspace(0.001, 0.5, num=100) rlasso = RandomizedLasso(alpha=0.04)
selector = StabilitySelection(base_estimator=rlasso, lambda_name='alpha', lambda_grid=lambda_grid, threshold=0.9, verbose=1) selector.fit(X_1, y_1) ranks["rlasso/Stability"] = ranking(np.abs(selector.stabilityscores.max(axis=1)), colnames) print('finished') `
The detailed error is: `
TypeError Traceback (most recent call last) ~\AppData\Local\Temp\ipykernel_26432\221803342.py in
5
6 lambda_grid = np.linspace(0.001, 0.5, num=100)
----> 7 rlasso = RandomizedLasso()
8
9 selector = StabilitySelection(base_estimator=rlasso, lambda_name='alpha',
~\anaconda3\envs\learn\lib\site-packages\stability_selection-0.0.1-py3.9.egg\stability_selection\randomized_lasso.py in init(self, weakness, alpha, fit_intercept, normalize, precompute, copy_X, max_iter, tol, warm_start, positive, random_state, selection) 122 random_state=None, selection='cyclic'): 123 self.weakness = weakness --> 124 super(RandomizedLasso, self).init( 125 alpha=alpha, fit_intercept=fit_intercept, 126 normalize=normalize, precompute=precompute, copy_X=copy_X,
TypeError: init() got an unexpected keyword argument 'normalize'
`