best_alpha = ridge_scores.groupby('alpha').ic.mean().idxmax()
fig, axes = plt.subplots(ncols=2, figsize=(15, 5))
plot_ic_distribution(ridge_scores[ridge_scores.alpha == best_alpha],
ax=axes[0])
axes[0].set_title('Daily Information Coefficients')
top_coeffs = ridge_coeffs.loc[best_alpha].abs().sort_values().head(10).index #I think there may be some error
top_coeffs.tolist()
ridge_coeffs.loc[best_alpha, top_coeffs].sort_values().plot.barh(ax=axes[1],
title='Top 10 Coefficients')
sns.despine()
fig.tight_layout()
######################################################
-> "top_coeffs = ridge_coeffs.loc[best_alpha].abs().sort_values().head(10).index" maybe use sort_values(ascending = False) is better here?Since we want to caculate the most relevant coefficients,which means have top 10 high values?
best_alpha = ridge_scores.groupby('alpha').ic.mean().idxmax() fig, axes = plt.subplots(ncols=2, figsize=(15, 5)) plot_ic_distribution(ridge_scores[ridge_scores.alpha == best_alpha], ax=axes[0]) axes[0].set_title('Daily Information Coefficients') top_coeffs = ridge_coeffs.loc[best_alpha].abs().sort_values().head(10).index #I think there may be some error top_coeffs.tolist() ridge_coeffs.loc[best_alpha, top_coeffs].sort_values().plot.barh(ax=axes[1], title='Top 10 Coefficients') sns.despine() fig.tight_layout()
###################################################### -> "top_coeffs = ridge_coeffs.loc[best_alpha].abs().sort_values().head(10).index" maybe use sort_values(ascending = False) is better here?Since we want to caculate the most relevant coefficients,which means have top 10 high values?