I used Scikit learn selectKbest
to select the best features, around 500 from 900 of them. as follows where d is the dataframe of all the features.
from sklearn.feature_selection import SelectKBest, chi2, f_classif
X_new = SelectKBest(chi2, k=491).fit_transform(d, label_vs)
when I print X_new
it now, it gives me numbers only but I need name of the selected features to use them later on.
I tried things like X_new.dtype.names
but I did't got back anything and I tried to convert X_new
into data frame but the only columns names I got were
1, 2, 3, 4...
so is there a way to know what are the names of the selected features?