Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

The "n_resampling" parameter of RandomizedLogisticRegression and "scores_" of RandomizedLasso #32

Open
Roych13 opened this issue Feb 8, 2020 · 0 comments

Comments

@Roych13
Copy link

Roych13 commented Feb 8, 2020

from sklearn.datasets import make_classification
from stability_selection import RandomizedLogisticRegression
from stability_selection import RandomizedLasso

selector = RandomizedLogisticRegression(n_resampling=300, random_state=101)
selector.fit(xTrain, yTrain)
print('the selected features:%i' % sum(selector.get_support() != 0))
xTrainS = selector.transform(xTrain)
xTestS = selector.transform(xTest)
classifier.fit(xTrainS, yTrain)
print('the scores:%0.3f' % classifier.score(xTestS, yTest))

x, y = make_classification(n_samples=100, n_features=10,
                           n_informative=4, random_state=101)
rLasso = RandomizedLasso()
rLasso.fit(x, y)
print(list(enumerate(rLasso.scores_)))
print(rLasso.get_support())

THE ERROR SHOWS AS BELOW:

Traceback (most recent call last):

File "", line 5, in
selector = RandomizedLogisticRegression(n_resampling=300, random_state=101)

TypeError: init() got an unexpected keyword argument 'n_resampling'

AttributeError: 'RandomizedLasso' object has no attribute 'scores_'

'RandomizedLasso' object has no attribute 'get_support'

Could you tell me how to solve these problems?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant