Exemple #1
0
def plot1D():
    a = sutl.loadWithMETA()
    reg = a.s.value_counts().sort_index() * 0 + 1e-1
    p = (
    a.loc[(0.005, 'COMALE', 0)].s.value_counts().sort_index() / a.loc[(0.005, 'COMALE', 0)].shape[0] + reg * 0).fillna(
            0)
    reg = pd.Series(0.1, index=np.arange(-0.5, 0.5001, 0.01).round(2))
    pp = (-((p + reg).fillna(reg)).apply(np.log));
    pp = pp / pp.sum()
    # +pd.Series(reg.index,index=reg.index).abs()
    plt.figure(figsize=(12, 8), dpi=100);
    plt.subplot(2, 1, 1);
    p.plot();
    plt.ylabel('$P(s|y=0)$');
    plt.subplot(2, 1, 2);
    pp.plot();
    plt.ylabel('$P(s|y=1)$')
    plt.xlabel('$s$')
    mpl.rc('font', **{'family': 'serif', 'serif': ['Computer Modern'], 'size': 26});
    mpl.rc('text', usetex=True)
    plt.savefig(utl.paperFiguresPath + 'probS1D.pdf')
Exemple #2
0
    pp = pp / pp.sum()
    # +pd.Series(reg.index,index=reg.index).abs()
    plt.figure(figsize=(12, 8), dpi=100);
    plt.subplot(2, 1, 1);
    p.plot();
    plt.ylabel('$P(s|y=0)$');
    plt.subplot(2, 1, 2);
    pp.plot();
    plt.ylabel('$P(s|y=1)$')
    plt.xlabel('$s$')
    mpl.rc('font', **{'family': 'serif', 'serif': ['Computer Modern'], 'size': 26});
    mpl.rc('text', usetex=True)
    plt.savefig(utl.paperFiguresPath + 'probS1D.pdf')


a = sutl.loadWithMETA()
a['slr'] = (a.alt - a.null) * a.s * 1000

df = a.loc[(0.005, 'COMALE', 0)]
df.plot.scatter(x="x0", y="slr");
plt.show()
a
sns.jointplot(x="x0", y="slr", data=df, kind="kde", size=12);
plt.show()
reg = a.s.value_counts().sort_index() * 0 + 1e-1
p = (a.loc[(0.005, 'COMALE', 0)].s.value_counts().sort_index() / a.loc[(0.005, 'COMALE', 0)].shape[0] + reg * 0).fillna(
    0)
p
reg = pd.Series(0.1, index=np.arange(-0.5, 0.5001, 0.01).round(2))
pp = (-((p + reg).fillna(reg)).apply(np.log));
pp = pp / pp.sum()