Created
December 19, 2018 09:03
-
-
Save notha99y/98649300512d7737a075ed42b439433b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from xgboost import XGBClassifier | |
xgb_clf = XGBClassifier(max_depth=12, learning_rate=1e-4,n_estimators=500) | |
xgb_clf.fit(X_train, np.argmax(np.array(y_train), axis = 1)) | |
xgb_y_pred = xgb_clf.predict(X_val) | |
pd.Series(xgb_clf.feature_importances_, index = X_train.columns).nlargest(12).plot(kind = 'barh', | |
figsize = (10, 10), | |
title = 'Feature importance from XGBoost').invert_yaxis(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment