train_pos = data[data['label']==1]
train_neg = data[data['label']==0]
train = train.dropna()
test = test.dropna()
for i in ['city','lan', 'os', 'osv', 'ver', 'orientation', 'carrier', 'ntt', 'make']:
for i in data.columns:
try:
g = sns.kdeplot(train_pos[i], color="Red", shade = True)
g = sns.kdeplot(train_neg[i], ax = g, color="Blue", shade= True)
g.set_xlabel(i)
g.set_ylabel("Frequency")
g = g.legend(["train_pos","train_neg"])
tmp = 'train_pos_neg_' + i
plt.savefig('./train_pos_neg/%s.jpg'%tmp)
plt.show()
print('plot over:%s'%i)
except:
print('jump %s'%i)
数据挖掘-正负样本绘制&保存
最新推荐文章于 2023-05-29 17:01:13 发布