'F-score of important features in XGBOOST

How do I get feature importance data frame from a XGBOOST model in python? I noticed that the function plot_importance(xgb_model) gives f-scores while the function gives xgb_model.feature_importances_ gives different importance values. I am confused as to which is the correct way and why do we get different results from above functions/calls



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source