예제 #1
0
파일: main.py 프로젝트: jingzbu/SBDet
def old_caida():
    ROOT = '/home/wangjing/LocalResearch/CyberData/caida-data/'
    T = 4.33
    dur_set = np.linspace(0.1, T * 0.9, 20)

    lk_list = []
    for dur in dur_set:
        dat = load(ROOT + 'passive-2013-sigs-%f/sigs.pk' % (dur))
        sigs, nodes = old_pk_to_coo(dat, True)
        print('len sigs', len(sigs))
        # model, para, debug_ret = select_model(len(nodes), sigs, min([40, len(sigs)]), 200, True)
        model, para, debug_ret = select_model(len(nodes), sigs, len(sigs), 200,
                                              True)
        lk_list.append(debug_ret['ER'][2])
        print('log likelihood value', debug_ret['ER'][2])
        print('para', para)
        print('model', model)

    dump({
        'x': dur_set,
        'y': lk_list,
        'x_name': 'dur_set',
        'y_name': 'lk_list'
    }, './caida-backbone-er-different-window-size-large-sample.pk')

    P.plot(dur_set, lk_list)
    # P.plot(sdd)
    P.show()
    import ipdb
    ipdb.set_trace()
예제 #2
0
파일: main.py 프로젝트: jingzbu/SBDet
def plotv(name):
    dat = load(name)
    lk1, lk2, lk3 = release(dat, ['CHJ', 'BA', 'ER'], 2)
    P.subplot(211)
    P.plot(lk1, 'o--', lw=2, ms=15)
    P.plot(lk2, '>g', lw=2, ms=15)
    P.plot(lk3, 'xr-', lw=2, ms=15)
    P.legend(['CHJ', 'BA', 'ER'], loc=4)
    # P.title('log likelihood vs. n for BA(n, %i)' % (m))

    P.subplot(212)
    p1, p2, p3 = release(dat, ['CHJ', 'BA', 'ER'], 1)
    P.plot(p1, 'o--', lw=2, ms=15)
    P.plot(p2, '>g', lw=2, ms=15)
    P.plot(p3, 'xr-', lw=2, ms=15)
    P.legend(['CHJ', 'BA', 'ER'], loc=4)
    # P.title('parameters vs. n for BA(n, %i)' % (m))
    P.show()
예제 #3
0
파일: main.py 프로젝트: hbhzwj/SBDet
def plotv(name):
    dat = load(name)
    lk1, lk2, lk3 = release(dat, ['CHJ', 'BA', 'ER'], 2)
    P.subplot(211)
    P.plot(lk1, 'o--', lw=2, ms=15)
    P.plot(lk2, '>g', lw=2, ms=15)
    P.plot(lk3, 'xr-', lw=2, ms=15)
    P.legend(['CHJ', 'BA', 'ER'], loc=4)
    # P.title('log likelihood vs. n for BA(n, %i)' % (m))

    P.subplot(212)
    p1, p2, p3 = release(dat, ['CHJ', 'BA', 'ER'], 1)
    P.plot(p1, 'o--', lw=2, ms=15)
    P.plot(p2, '>g', lw=2, ms=15)
    P.plot(p3, 'xr-', lw=2, ms=15)
    P.legend(['CHJ', 'BA', 'ER'], loc=4)
    # P.title('parameters vs. n for BA(n, %i)' % (m))
    P.show()
예제 #4
0
파일: main.py 프로젝트: hbhzwj/SBDet
def old_caida():
    ROOT = '/home/wangjing/LocalResearch/CyberData/caida-data/'
    T = 4.33
    dur_set = np.linspace(0.1, T*0.9, 20)

    lk_list = []
    for dur in dur_set:
        dat = load(ROOT+'passive-2013-sigs-%f/sigs.pk' % (dur))
        sigs, nodes = old_pk_to_coo(dat, True)
        print('len sigs', len(sigs))
        # model, para, debug_ret = select_model(len(nodes), sigs, min([40, len(sigs)]), 200, True)
        model, para, debug_ret = select_model(len(nodes), sigs, len(sigs), 200, True)
        lk_list.append(debug_ret['ER'][2])
        print('log likelihood value', debug_ret['ER'][2])
        print('para', para)
        print('model', model)

    dump({'x':dur_set, 'y':lk_list, 'x_name':'dur_set', 'y_name':'lk_list'},
            './caida-backbone-er-different-window-size-large-sample.pk')

    P.plot(dur_set, lk_list)
    # P.plot(sdd)
    P.show()
    import ipdb;ipdb.set_trace()