如何绘制两个结果的预测概率分布

时间:2019-11-26 00:27:50

标签: python plot distribution

我正在尝试通过模型针对正(true = 1)和负(true = 0)的结果绘制预测概率分布,如下所示:

enter image description here

我有一个数据框bb,其中有两列:truepredicted_prob

我尝试过:

target_0 = bb.loc[bb['true'] == 0]
target_1 = bb.loc[bb['true'] == 1]
p1=sns.kdeplot(target_1['pred'], shade=True, color="r", label="1")
p1=sns.kdeplot(target_0['pred'], shade=True, color="b", label="0")
plt.xlim(0, 1)
plt.title('add title here')

但是y_axis看起来不正确...应该是概率,所以介于0和1之间,或者计数并且更高。 len(target_1)= 14K,len(target_0)= 50K。我不明白y_axis代表的是什么。

enter image description here

0 个答案:

没有答案