If I have a dataset , How to use SFS to rank (order) the selected features? e.g: from sklearn.feature_selection import S

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

If I have a dataset , How to use SFS to rank (order) the selected features? e.g: from sklearn.feature_selection import S

Post by answerhappygod »

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?
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply