Exemple #1
0
    # first_noise = 10

    #非异常点每一类的排序,key类别号
    res_get_s = {}

    for key in res:
        temp_dense = []
        for l in res[key]:
            temp_dense.append(dense_output[l])
        temp_dense = np.array(temp_dense)
        temp_label = np.full((len(temp_dense)), key)
        mmd_res, _ = run(temp_dense,
                         temp_label,
                         gamma=0.026,
                         m=min(len(temp_dense), 180),
                         k=0,
                         ktype=0,
                         outfig=None,
                         critoutfig=None,
                         testfile=os.path.join(basedir, 'data/a.txt'))
        res_get_s[key] = mmd_res

    #将结果保存到excel
    workbook = openpyxl.Workbook()
    sheet = workbook.active

    row_num = 5
    for a_unoise in arange(0.8, 0.9, 0.1):
        print(a_unoise)
        dss = get_std1(X_test=X_test,
                       Y_test=Y_test,
Exemple #2
0
    # # first_noise = 10
    #
    # #非异常点每一类的排序,key类别号
    # res_get_s = {}

    # for key in res:
    # temp_dense = []
    # for l in res[key]:
    #     temp_dense.append(dense_output[l])
    # temp_dense = np.array(temp_dense)
    # temp_label = np.full((len(temp_dense)), key)
    mmd_res, _ = run(dense_output,
                     Y_test,
                     gamma=0.026,
                     m=min(len(dense_output), 180),
                     k=0,
                     ktype=0,
                     outfig=None,
                     critoutfig=None,
                     testfile=os.path.join(basedir, 'data/a.txt'))
    # res_get_s[key] = mmd_res
    print(mmd_res)

    #将结果保存到excel
    workbook = openpyxl.Workbook()
    sheet = workbook.active

    row_num = 5
    for a_unoise in arange(0.8, 0.9, 0.1):
        print(a_unoise)
        dss = get_std1(X_test=X_test,