def plot_score_distribution(y_pred, so):
""" Plots scores of predicted values """
min_x = min(min(y_pred), 0)
max_x = max(max(y_pred), 1)
sns.distplot(y_pred, kde=False)
plt.title("distribution of scores for {} model".format(so['model_name']))
plt.xlabel("raw prediction score")
plt.xlim([min_x, max_x])
plt.ylabel("number of street segments")
base = so['results_dir'] + so['model_name'] + "_" + \
str(so['timestamp']) + "_" + so['break_window']
plt.savefig(base + '_score_distribution.png', bbox_inches='tight')
plt.close()
评论列表
文章目录