Created
August 3, 2018 21:08
-
-
Save ImadDabbura/b22b0ead7befabdaaef89a35f51b5c41 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
| # Plot partial dependence plots | |
| gbrt = GradientBoostingClassifier(loss="deviance", | |
| learning_rate=0.1, | |
| n_estimators=100, | |
| max_depth=3, | |
| random_state=123) | |
| gbrt.fit(X_res, y_res) | |
| fig, axes = plot_partial_dependence(gbrt, | |
| X_res, | |
| np.argsort(gbrt.feature_importances_)[::-1][:8], | |
| n_cols=4, | |
| feature_names=df.columns[:-6], | |
| figsize=(14, 8)) | |
| plt.subplots_adjust(top=0.9) | |
| plt.suptitle("Partial dependence plots of borrower not fully paid\n" + | |
| "the loan based on top most influential features") | |
| for ax in axes: | |
| ax.set_xticks(()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment