Find Selected Functions RandomizedLogisticRegression

I am doing a binary classification by 300Ksamples and 19 functions. I have used RandomizedLogisticRegression () in scikit to select a feature. I would like to know how I can find which functions are selected by RandomizedLogisticRegression ().

+3


source to share


1 answer


You have to use the function get_support

:

from sklearn.datasets import load_iris
from sklearn.linear_model import RandomizedLogisticRegression

iris = load_iris()
X, y = iris.data, iris.target

clf = RandomizedLogisticRegression()
clf.fit(X,y)
print clf.get_support()

#prints [False  True  True  True]

      



Alternatively, you can get the support function indices:

print clf.get_support(indices=True)
#prints [1 2 3]

      

+4


source







All Articles