コード例 #1
0
    def test_a(self):
        gcd_res = readCompleteMatFile(r'C:\Users\ORI\Documents\Thesis\dataset_all\RSVP_Color116msVPicr.mat');
        all_data, columns, all_data_for_sum = create_target_table(gcd_res, gcd_res['target'])
        results_table = pd.DataFrame( all_data)
        results_table.rename(columns=columns, inplace=True)
        # print results_table.columns
        results_table.to_csv('res.csv')
        # print results_table

        #now get a vector of random probabilities:


        temp = np.random.rand(len(gcd_res['target']),1)

        all_data2, columns2, all_data_for_sum2 = create_target_table(gcd_res, temp)



        # sum over the trials axe compare
        gt = np.argmax(np.sum(all_data_for_sum, axis=1),axis=1)
        actual = np.argmax(np.sum(all_data_for_sum2, axis=1),axis=1)
        print accuracy_by_repetition(all_data_for_sum, all_data_for_sum2)



        results_table2 = pd.DataFrame( all_data2)
        results_table2.rename(columns=columns2, inplace=True)
        # print results_table.columns
        results_table2.to_csv('res2.csv')



        temp2 = results_table2[all_data2[:, 1]<3, :]
        pass
コード例 #2
0
    def test_a(self):
        gcd_res = readCompleteMatFile(
            r'C:\Users\ORI\Documents\Thesis\dataset_all\RSVP_Color116msVPicr.mat'
        )
        all_data, columns, all_data_for_sum = create_target_table(
            gcd_res, gcd_res['target'])
        results_table = pd.DataFrame(all_data)
        results_table.rename(columns=columns, inplace=True)
        # print results_table.columns
        results_table.to_csv('res.csv')
        # print results_table

        #now get a vector of random probabilities:

        temp = np.random.rand(len(gcd_res['target']), 1)

        all_data2, columns2, all_data_for_sum2 = create_target_table(
            gcd_res, temp)

        # sum over the trials axe compare
        gt = np.argmax(np.sum(all_data_for_sum, axis=1), axis=1)
        actual = np.argmax(np.sum(all_data_for_sum2, axis=1), axis=1)
        print accuracy_by_repetition(all_data_for_sum, all_data_for_sum2)

        results_table2 = pd.DataFrame(all_data2)
        results_table2.rename(columns=columns2, inplace=True)
        # print results_table.columns
        results_table2.to_csv('res2.csv')

        temp2 = results_table2[all_data2[:, 1] < 3, :]
        pass
コード例 #3
0
ファイル: module1.py プロジェクト: Ori226/thesis_clean_v3
def LoadSingleSubjectPythonNoPermute(file_name):

    res = readCompleteMatFile(file_name)

    all_data, all_tags = ExtractDataVer3(res["all_relevant_channels"], res["marker_positions"], res["target"], 0, 400)

    trasposed_data = all_data.transpose(0, 2, 1)

    trasposed_data = trasposed_data.reshape(trasposed_data.shape[0], -1)

    all_target = trasposed_data[np.where(all_tags == 1)[0], :]
    all_non_target = trasposed_data[np.where(all_tags != 1)[0], :]

    subset_size = all_target.shape[0]

    all_target = all_target
    all_non_target = all_non_target
    return [all_target, all_non_target, res["marker_positions"]]
コード例 #4
0
def LoadSingleSubjectPythonNoPermute(file_name):

    res = readCompleteMatFile(file_name)

    all_data, all_tags = ExtractDataVer3(res['all_relevant_channels'],
                                         res['marker_positions'],
                                         res['target'], 0, 400)

    trasposed_data = all_data.transpose(0, 2, 1)

    trasposed_data = trasposed_data.reshape(trasposed_data.shape[0], -1)

    all_target = trasposed_data[np.where(all_tags == 1)[0], :]
    all_non_target = trasposed_data[np.where(all_tags != 1)[0], :]

    subset_size = all_target.shape[0]

    all_target = all_target
    all_non_target = all_non_target
    return [all_target, all_non_target, res['marker_positions']]