How to get the right feature names in sequential feature selection?

791 views Asked by At

I am running sequential feature selection in python on a model of 10 predictors with 80% percent accuracy. However I am not able to get the feature names, instead feature id is repeated as names. Also, I cannot make sense of feature id as the numbers they show is greater than number of features in the data. How can I get the feature name as in my dataset and make sense of feature id?

pd.DataFrame.from_dict(sfs.get_metric_dict()).T

enter image description here

1

There are 1 answers

1
Mason Kadem On

Try this:

sfs = sfs.fit(X, y, custom_feature_names=list(X.columns))

results = pd.DataFrame.from_dict(sfs.get_metric_dict()).T