1#importing the necessary libraries
2from mlxtend.feature_selection import SequentialFeatureSelector as SFS
3from sklearn.linear_model import LinearRegression
4# Sequential Forward Selection(sfs)
5sfs = SFS(LinearRegression(),
6 k_features=11,
7 forward=True,
8 floating=False,
9 scoring = 'r2',
10 cv = 0)
11
12sfs.fit(X, y)
13sfs.k_feature_names_ # to get the final set of features