Last active
October 5, 2017 08:56
-
-
Save danyashorokh/563ea8b5b617ce9157ce563641d95c2b to your computer and use it in GitHub Desktop.
[Python] Important model features
This file contains 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
clf = ensemble.GradientBoostingClassifier(**BOOSTING_PARAMS) | |
clf.fit(X_train, y_train) | |
predictors = [x for x in df_fin.columns if x not in ['ID1', 'ID2']] | |
feat_imp = pd.Series(clf.feature_importances_, index=predictors).sort_values(ascending=False) | |
# print(feat_imp.axes, feat_imp.values) | |
with open('path', 'a') as f: | |
for el in feat_imp.iteritems(): | |
f.write(str(el)+'\n') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment