I am struggling with saving the xgboost feature-importance plot to a file. I have created a model and plotted importance of features in my jupyter notebook-
xgb_model = xgboost.train(best_params, dtrain, num_round)
xgboost.plot_importance(xgb_model)
It shows me the feature importance plot but I am unable to save it to a file. I even looked for any save attribute in dir(xgboost.plot_importance(xgb_model))
, but got nothing. Is there any way to do this?