📅  最后修改于: 2022-03-11 14:47:18.783000             🧑  作者: Mango
#importing the necessary libraries
from mlxtend.feature_selection import SequentialFeatureSelector as SFS
from sklearn.linear_model import LinearRegression
# Sequential Forward Selection(sfs)
sfs = SFS(LinearRegression(),
k_features=11,
forward=True,
floating=False,
scoring = 'r2',
cv = 0)
sfs.fit(X, y)
sfs.k_feature_names_ # to get the final set of features