Beispiel #1
0
def main():
    out_dir = 'speedup/out/kjl'
    try:
        ###########################################################################################################
        # Get results with IAT_SIZE
        main1(
            feats=[('feat', 'iat_size')],
            headers=[('is_header', False)],
            gses=[('is_gs', False)],
            before_projs=[
                ('before_proj', False),
            ],
            ds=[
                ('d_kjl', 5),
            ],
            train_sizes=[('train_size', 5000)],
            out_dir=out_dir,
        )
        ###########################################################################################################
        # Get results with STATS
        main1(
            feats=[('feat', 'stats')],
            headers=[('is_header', True)],
            # gses=[('is_gs', False)],
            before_projs=[
                ('before_proj', False),
            ],
            ds=[
                ('d_kjl', 5),
            ],
            out_dir=out_dir,
        )
    except Exception as e:
        traceback.print_exc()
        lg.error(e)

    ###########################################################################################################
    # Merge all results
    merge_res(
        in_dir=out_dir,
        datasets=DATASETS,
        directions=[
            ('direction', 'src_dst'),
        ],
        feats=[
            ('feat', 'iat_size'),
            ('feat', 'stats'),
        ],
        # headers=[('is_header', False)],
        models=MODELS,
        # gses=[('is_gs', True), ('is_gs', False)],
        before_projs=[
            ('before_proj', False),
        ],
        ds=[
            ('d_kjl', 5),
        ],
    )
Beispiel #2
0
def main(dataset = 'CTU1', model='OCSVM(rbf)', start_time = None):
    # out_dir = 'speedup/out/kjl_parallel_30'
    out_dir = 'speedup/out/kjl_serial_ind_32_threads'
    out_dir = 'speedup/out/kjl_serial_ind_1_thread'
    out_dir = 'speedup/out/kjl_serial_ind_32_threads-cProfile_perf_counter'
    # out_dir = 'speedup/out/kjl_serial_ind_1_thread-cProfile_perf_counter'
    # out_dir = 'speedup/out/kjl_serial_ind_32_threads-cProfile_perf_counter-libsvm'
    out_dir = 'speedup/out/kjl_serial_ind_32_threads-cProfile_perf_counter-2'

    # # # out_dir = 'speedup/out/kjl-with_init_params'    # modify __speedup_kjl.py
    # DATASETS = [dataset]
    # MODELS = [model]
    # try:
    #     ###########################################################################################################
    #     # Get results with IAT_SIZE
    #     main1(DATASETS, MODELS,
    #           feats=[('feat', 'iat_size')],
    #           headers=[('is_header', False)],
    #           # gses=[('is_gs', True)],
    #           before_projs=[('before_proj', False), ],
    #           ds=[('kjl_d', 5), ],
    #           train_sizes=[('train_size', 5000)],
    #           out_dir=out_dir,
    #           )
    #     ##########################################################################################################
    #     # Get results with STATS
    #     main1(DATASETS, MODELS,
    #         feats=[('feat', 'stats')],
    #          headers=[('is_header', True)],
    #          # gses=[('is_gs', False)],
    #          before_projs=[('before_proj', False), ],
    #          ds=[('kjl_d', 5), ],
    #          out_dir = out_dir,
    #          )
    # except Exception as e:
    #     traceback.print_exc()
    #     lg.error(e)
    #
    # ###########################################################################################################
    # Merge all results
    merge_res(in_dir=out_dir, datasets=DATASETS,
              directions=[('direction', 'src_dst'), ],
              feats=[('feat', 'iat_size'), ('feat', 'stats'), ],
              headers=[('is_header', False)],
              models=MODELS,
              # gses=[('is_gs', True), ('is_gs', False)],
              before_projs=[('before_proj', False), ],
              ds=[('kjl_d', 5), ], )
            ],
            ds=[
                ('d_kjl', 5),
            ],
            out_dir=out_dir,
        )
    except Exception as e:
        traceback.print_exc()
        lg.error(e)

    merge_res(
        in_dir=out_dir,
        datasets=DATASETS,
        directions=[
            ('direction', 'src_dst'),
        ],
        feats=[
            ('feat', 'iat_size'),
            ('feat', 'stats'),
            ('feat', 'samp_size'),
        ],
        headers=[('is_header', True), ('is_header', False)],
        models=MODELS,
        gses=[('is_gs', True), ('is_gs', False)],
        before_projs=[
            ('before_proj', False),
        ],
        ds=[
            ('d_kjl', 5),
        ],
    )