Skip to content

Commit

Permalink
remove figure saving
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-jansen committed Apr 30, 2021
1 parent 96465b9 commit 20cb7fc
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 31 deletions.
2 changes: 1 addition & 1 deletion 07_linear_models/01_linear_regression_intro.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@
"plt.axis('off')\n",
"plt.tight_layout()\n",
"plt.subplots_adjust(left=0.2, right=0.8, top=0.8, bottom=0.1)\n",
"# plt.savefig('figures/multiple_regression_summary.png', bbox_inches='tight', dpi=300);"
"# plt.savefig('multiple_regression_summary.png', bbox_inches='tight', dpi=300);"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion 08_ml4t_workflow/03_backtesting_with_backtrader.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@
"source": [
"# cerebro.plot() # plot the results\n",
"# figure = cerebro.plot(style='candlebars')[0][0]\n",
"# figure.savefig(f'figures/backtrader.png')"
"# figure.savefig(f'backtrader.png')"
]
},
{
Expand Down
6 changes: 2 additions & 4 deletions 12_gradient_boosting_machines/01_boosting_baseline.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1764,8 +1764,7 @@
"axes[1][1].set_ylabel('6-Months Return')\n",
"fig.suptitle('Partial Dependence Plots', fontsize=16)\n",
"fig.tight_layout()\n",
"fig.subplots_adjust(top=.95)\n",
"fig.savefig('figures/partial_dep_2d', dpi=300);"
"fig.subplots_adjust(top=.95)\n"
]
},
{
Expand Down Expand Up @@ -1822,8 +1821,7 @@
"\n",
"# fig.colorbar(surface)\n",
"fig.suptitle('Partial Dependence by 6- and 12-month Returns', fontsize=16)\n",
"fig.tight_layout()\n",
"fig.savefig('figures/partial_dep_3d', dpi=300)"
"fig.tight_layout()\n"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,7 @@
"fig.suptitle('Mean Test Score Distribution by Hyperparameter', fontsize=14)\n",
"fig.tight_layout()\n",
"fig.subplots_adjust(top=.94)\n",
"fig.savefig('figures/sklearn_cv_scores_by_param', dpi=300);"
"fig.savefig('sklearn_cv_scores_by_param', dpi=300);"
]
},
{
Expand Down
12 changes: 4 additions & 8 deletions 12_gradient_boosting_machines/06_evaluate_trading_signals.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -900,8 +900,7 @@
" axes[i].set_title(f'Lookahead: {t} Day(s)')\n",
"fig.suptitle('OLS Coefficients & Confidence Intervals', fontsize=20)\n",
"fig.tight_layout()\n",
"fig.subplots_adjust(top=.92)\n",
"fig.savefig('figures/ols_coefs', dpi=300);"
"fig.subplots_adjust(top=.92)\n"
]
},
{
Expand Down Expand Up @@ -2359,8 +2358,7 @@
"\n",
"fig.suptitle('3-Month Rolling Information Coefficient', fontsize=16)\n",
"fig.tight_layout()\n",
"fig.subplots_adjust(top=0.92)\n",
"fig.savefig('figures/rolling_ic_lgb', dpi=300);"
"fig.subplots_adjust(top=0.92)\n";
]
},
{
Expand Down Expand Up @@ -2815,8 +2813,7 @@
"\n",
"fig.suptitle('Alphalens - Validation Set Performance', fontsize=14)\n",
"fig.tight_layout()\n",
"fig.subplots_adjust(top=.85)\n",
"fig.savefig('figures/alphalens_cv', dpi=300)"
"fig.subplots_adjust(top=.85)\n";
]
},
{
Expand Down Expand Up @@ -3943,8 +3940,7 @@
"\n",
"fig.suptitle('3-Month Rolling Information Coefficient', fontsize=16)\n",
"fig.tight_layout()\n",
"fig.subplots_adjust(top=0.92)\n",
"fig.savefig('figures/rolling_ic_cb', dpi=300);"
"fig.subplots_adjust(top=0.92);"
]
},
{
Expand Down
15 changes: 5 additions & 10 deletions 12_gradient_boosting_machines/07_model_interpretation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -570,8 +570,7 @@
" rot=0))\n",
"plt.suptitle('Normalized Importance (Top 20 Features)', fontsize=14)\n",
"plt.tight_layout()\n",
"plt.subplots_adjust(top=.9)\n",
"plt.savefig('figures/lgb_fi', dpi=300)"
"plt.subplots_adjust(top=.9);"
]
},
{
Expand Down Expand Up @@ -755,8 +754,7 @@
"axes[1][1].set_ylabel('6-Months Return')\n",
"fig.suptitle('Partial Dependence Plots', fontsize=16)\n",
"fig.tight_layout()\n",
"fig.subplots_adjust(top=.95)\n",
"fig.savefig('figures/partial_dep_2d', dpi=300);"
"fig.subplots_adjust(top=.95);"
]
},
{
Expand Down Expand Up @@ -821,8 +819,7 @@
"\n",
"# fig.colorbar(surface)\n",
"fig.suptitle('Partial Dependence by 6- and 12-month Returns', fontsize=16)\n",
"fig.tight_layout()\n",
"fig.savefig('figures/partial_dep_3d', dpi=300)"
"fig.tight_layout();"
]
},
{
Expand Down Expand Up @@ -952,8 +949,7 @@
"shap_values = explainer.shap_values(X=X)\n",
"\n",
"shap.summary_plot(shap_values, X, show=False)\n",
"plt.tight_layout()\n",
"plt.savefig('figures/shap_dots', dpi=300)"
"plt.tight_layout();"
]
},
{
Expand All @@ -979,8 +975,7 @@
],
"source": [
"shap.summary_plot(shap_values, X, plot_type=\"bar\",show=False)\n",
"plt.tight_layout()\n",
"plt.savefig('figures/shap_bar', dpi=300)"
"plt.tight_layout();"
]
},
{
Expand Down
3 changes: 1 addition & 2 deletions 16_word_embeddings/05_financial_news_word2vec_gensim.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1257,8 +1257,7 @@
"(pd.DataFrame(most_sim, columns=['token', 'similarity'])\n",
" .set_index('token').similarity\n",
" .sort_values().tail(10).plot.barh(xlim=(.3, .37), ax=axes[1], title='Closest matches for Woman + King - Man'))\n",
"fig.tight_layout()\n",
"fig.savefig('figures/w2v_evaluation', dpi=300);"
"fig.tight_layout();"
]
},
{
Expand Down
3 changes: 1 addition & 2 deletions 16_word_embeddings/07_sec_word2vec.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1307,8 +1307,7 @@
"(pd.DataFrame(most_sim, columns=['token', 'similarity'])\n",
" .set_index('token').similarity\n",
" .sort_values().tail(10).plot.barh(xlim=(.3, .37), ax=axes[1], title='Closest matches for Woman + King - Man'))\n",
"fig.tight_layout()\n",
"# fig.savefig('figures/w2v_sec_evaluation', dpi=300);"
"fig.tight_layout();"
]
}
],
Expand Down
3 changes: 1 addition & 2 deletions 24_alpha_factor_library/05_alphalens_analysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -480,8 +480,7 @@
" freq=pd.tseries.offsets.BDay(),\n",
" period='1D',\n",
" ax=axes[2])\n",
"fig.tight_layout()\n",
"fig.savefig('figures/alphalens', dpi=300)"
"fig.tight_layout();"
]
},
{
Expand Down

0 comments on commit 20cb7fc

Please sign in to comment.