Beispiel #1
0
def recipt_vs_overlap(re, o, name= path + '/recip_overlap.pdf'):
    g = plots.linlinjointdistr(re, o, xlim=(0, .5), xlabel=r'$r_{ij}$')
    g.savefig(name)
Beispiel #2
0
def weight_vs_overlap_rank(w, o, path=path, name= 'weight_overlap.png', ylim=(0, 1), xlim=(0, 1)):
    n = len(w) + 0.
    g = plots.linlinjointdistr(rankdata(w)/n, rankdata(o)/n, height=5, ylim=ylim, xlim=xlim, kind='scatter')
    g.savefig(path + '/' + name)
    return g
Beispiel #3
0
def bt_tsig_vs_overlap(tsig, o, name= path + '/bt-tsig_overlap.pdf'):
    idx = tsig.notnull()
    g = plots.linlinjointdistr(tsig[idx], o[idx], xlim=(0, .5), xlabel=r'$\sigma_{t^b}$')
    g.savefig(name)
Beispiel #4
0
def bt_tlog_vs_overlap(tlog, o, name= path + '/bt-tlog_overlap.pdf'):
    idx = (tlog.notnull()) & (tlog < np.inf)
    g = plots.linlinjointdistr(tlog[idx], o[idx], xlim=(-5, 6), xlabel=r'$\log{(T_{t^b})}$', gridsize=(45, 55))
    g.savefig(name)
Beispiel #5
0
def bt_tmu_vs_overlap(tmu, o, name= path + '/bt-tmu_overlap.pdf'):
    g = plots.linlinjointdistr(tmu, o, xlim=(0, 1), xlabel=r'$\bar{t^b}$', ylim=(0, .3))
    g.savefig(name)
Beispiel #6
0
def m_vs_overlap(m, o, name= path + '/iet-m_overlap.pdf'):
    idx = m.notnull()
    g = plots.linlinjointdistr(m[idx], o[idx], height=5, xlabel=r'$M_{ij}$', xlim=(-1, 1))
    g.savefig(name)
Beispiel #7
0
def tmp_stab_vs_overlap(t, o, name= path + '/t-stab_overlap.pdf'):
    g = plots.linlinjointdistr(t, o, height=5, xlabel=r'$TS$', xlim=(-1, 120))
    g.savefig(name)
Beispiel #8
0
def age_vs_overlap(age, o, name= path + '/age_overlap.pdf'):
    g = plots.linlinjointdistr(age, o, height=5, xlabel=r'$age$', xlim=(0, max(age)))
    g.savefig(name)
Beispiel #9
0
    tmp = pd.read_csv('full_run/temporal_overlap.txt', sep=' ')
    max_idx = tmp.shape[0]
    net = net.iloc[range(max_idx)]

    idx = (tmp.ov_mean > 0) & (tmp.ovrl > 0)
    g = plots.loglogjointdistr(tmp.ovrl[idx], tmp.ov_mean[idx], xlim=(.01, 1), ylim=(.01, 1), xlabel=r'$O_{ij}$', ylabel=r'$\bar{O^t_{ij}}$', gridsize=(55, 35))
    g.savefig(path + '/overlap_joint.pdf')

    fig, ax = plt.subplots(1)
    ax.hist(tmp.ov_mean, 100, alpha=.3, label=r'$\bar{O^t_{ij}}$', log=True, normed=True)
    ax.hist(tmp.ov_mean[tmp.all_t_comm > 0], 100, alpha=.3, label=r'$All neighbors$', log=True, normed=True)
    ax.hist(tmp.ov_mean[tmp.no_t_comm > 0], 100, alpha=.3, label=r'$No Neighbors$', log=True, normed=True)
    ax.legend(loc=0)

    tmp['noc_frac'] = (tmp.no_t_comm + .0)/(tmp.all_t_comm + tmp.some_t_comm + tmp.no_t_comm)
    plots.linlinjointdistr(tmp.noc_frac[idx], tmp.ovrl[idx], xlim=(0, 1), ylim=(0., .3))

    idx = tmp.w > 2
    possible = tmp[idx].index
    samp = np.random.choice(possible, 1000000)

    tmp = tmp.iloc[samp]
    tmp.to_csv('full_run/tmp_samp2.txt', index=False, sep=' ')
###### TODO: DELETE
# This is for obtaining a sample for week vec. So far we got the first i=3353197
    w = open('full_run/wv_samp.txt', 'w')
    r = open('full_run/week_vec_call.txt', 'r')
    i = 0
    row = r.readline()
    while row:
        if i in samp: