If I have a dataset , How to use SFS to rank (order) theselected features?
e.g:
from sklearn.feature_selection import SequentialFeatureSelector
from sklearn.datasets import load_diabetes
diabetes = load_diabetes()
X, y = diabetes.data, diabetes.target
sfs_selector = SequentialFeatureSelector(estimator=LinearRegression(), n_features_to_select = 9, direction ='forward')
sfs_selector.fit(X, y)
df.columns[sfs_selector.get_support()]
when set " n_features_to_select = 9" , itprint all features.
I hope to get a rank of features selection. What should Ido?
If I have a dataset , How to use SFS to rank (order) the selected features? e.g: from sklearn.feature_selection import S
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am