I would like to ask if there is a way to pull the names of the most important features and save them in pandas data frame. I know how to plot them and how to get them, but I'm looking for a way to save the most important features in a data frame.
from xgboost import XGBClassifier
from xgboost import plot_importance
# fit model to training data
xgb_model = XGBClassifier(random_state=0)
xgb_model.fit(X, y)
print("Feature Importances : ", xgb_model.feature_importances_)
# plot feature importance
fig, ax = plt.subplots(figsize=(15, 10))
plot_importance(xgb_model, max_num_features=35, height=1, ax=ax)
plt.show()