Exemplo n.º 1
0
P_corr_pe_plot = P_corr_pe.copy()
P_corr_pe_plot[mask] = 3
P_corr_pe_plot = P_corr_pe_plot.astype(int)
WTD_corr_pe_plot = WTD_corr_pe.copy()
WTD_corr_pe_plot[mask] = 3
WTD_corr_pe_plot = WTD_corr_pe_plot.astype(int)
classification_pe_plot = cmap[P_corr_pe_plot, WTD_corr_pe_plot]

# CONFUSION MATRIX LAYOUT
cmap_cm = cmap_2d((3, 3), alpha=0.5, diverging_alpha=0.25).astype(np.float32)
cmap_cm[1, 1, :] = (0.9, 0.9, 0.9)
cm_empty = np.full((10, 10), np.nan, dtype=float)
cm_empty[0, :] = np.arange(10) - 1
cm_empty[:, 0] = np.arange(10) - 1
cmap_cm = ListedColormap(np.vstack([[1, 1, 1], cmap_cm.reshape(9, 3)]))

l = [cm_t, cm_bs, cm_pe]
labels = [
    "T-test classification", "Bootstrap classification",
    "Permutation test classification"
]
maps = [classification_t_plot, classification_bs_plot, classification_pe_plot]

f, ax = plt.subplots(ncols=3, nrows=2, figsize=(20, 20))
ax = ax.flatten()
plt.tight_layout(h_pad=-40, w_pad=2)
ax[:3] = [
    mp.basemap(*M_wtd.bounds,
               ax=cax,
               resolution='50m',