Skip to content

Instantly share code, notes, and snippets.

@Davisy
Created April 26, 2020 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Davisy/3b8f8afafb2f567e37b00e5997e782a1 to your computer and use it in GitHub Desktop.
Save Davisy/3b8f8afafb2f567e37b00e5997e782a1 to your computer and use it in GitHub Desktop.
xgb_classifier = XGBClassifier(n_jobs=-1)
# train
xgb_classifier.fit(X_train, y_train)
# Generates a plot of a classifier's feature importances
skplt.estimators.plot_feature_importances(
xgb_classifier,
feature_names=feature_columns,
figsize=(10, 8),
title="Feature Importance for XGB Classifier",
x_tick_rotation=90,
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment