i performed feature selection using ExtraTreesClassifier and SelectFromModel in data set that loaded as DataFrame, however i want to save these selected feature as DataFrame
model = SelectFromModel(clf, prefit=True)
feature_idx = model.get_support()
feature_name = df.columns[feature_idx]
Use the method DataFrame.to_csv()
to save your dataframe as a csv
file.
Do the following :
X_new.to_csv("your/path", sep=';')
Here is a link to the documentation of the method.