繪圖專區
# 改變繪圖樣式 (style)
直方圖之類的
plt.style.use('ggplot')
plt.hist(app_train['DAYS_BIRTH'] / 365, edgecolor = 'k', bins = 25)
sns.kdeplot(app_train.loc[app_train['TARGET'] == 0, 'DAYS_BIRTH'] / 365, label = 'target == 0')
sns.kdeplot(app_train.loc[app_train['TARGET'] == 1, 'DAYS_BIRTH'] / 365, label = 'target == 1')
sns.distplot(app_train.loc[app_train['TARGET'] == 1, 'DAYS_BIRTH'] / 365, label = 'target == 1')
# Heatmap
如果是兩個欄資料,可以用 plot plt.plot(x1, x2) 看
sns.heatmap(ext_data_corrs, cmap = plt.cm.RdYlBu_r, vmin = -0.25, annot = True, vmax = 0.6)
grid = sns.PairGrid(Data)
grid.map_upper(plt.scatter)
gird.map_diag(sns.kdeplot)
grid.map_lower(sns.kde.plot, cmap=plt.cm.OrRd_r)
Model flow
model.summary()
from keras.utils import plot_model
plot_model(model, to_file='model.png')