Horje
xgboost feature importance Code Example
xgboost feature importance
import matplotlib.pyplot as plt
from xgboost import plot_importance, XGBClassifier # or XGBRegressor

model = XGBClassifier() # or XGBRegressor

# X and y are input and target arrays of numeric variables
model.fit(X,y)
plot_importance(model, importance_type = 'gain') # other options available
plt.show()
# if you need a dictionary 
model.get_booster().get_score(importance_type = 'gain')




Python

Related
python ping ip address Code Example python ping ip address Code Example
how to make computer go in sleep mode using pythn Code Example how to make computer go in sleep mode using pythn Code Example
divide by zero error python exception handling Code Example divide by zero error python exception handling Code Example
format date field in pandas Code Example format date field in pandas Code Example
what happen when we apply * before list in python Code Example what happen when we apply * before list in python Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8