예제 #1
0
def sort_by_standard_deviation():

    global transposed_raw_data_matrix
    global ALL_count
    global MLL_count
    global AML_count
    global snr_tuples
    global progressbar_total

    sample_length = len(transposed_raw_data_matrix[0])
    sample_count = len(transposed_raw_data_matrix)
    MLL_end_index = ALL_count + MLL_count

    for attribute_index in range(sample_length - 1):

        attribute_list = list()

        for sample_index in range(sample_count):
            attribute_list.append(
                transposed_raw_data_matrix[sample_index][attribute_index])

        sd_value = statistics.standard_deviation(
            attribute_list[:ALL_count]) + statistics.standard_deviation(
                attribute_list[ALL_count:MLL_end_index]
            ) + statistics.standard_deviation(attribute_list[MLL_end_index:])
        rounded_sd = math.ceil(sd_value * 10000) / 10000
        snr_tuples.append((attribute_index, rounded_sd))

    sort.randomized_quick_sort_for_tuples(snr_tuples, 0, len(snr_tuples) - 1)

    progressbar.show(9,
                     progressbar_total,
                     prefix="Progress:",
                     suffix="Complete",
                     length=50)
예제 #2
0
def sort_by_SNR():

    global data_matrix
    global after_th_count
    global snr_tuples
    global progressbar_total

    sample_length = len(data_matrix[0])
    sample_count = len(data_matrix)

    for attribute_index in range(sample_length - 1):

        attribute_list = list()

        for sample_index in range(sample_count):
            attribute_list.append(data_matrix[sample_index][attribute_index])

        snr_value = snr.mod_SNR(attribute_list[:after_th_count],
                                attribute_list[after_th_count:])
        rounded_snr = math.ceil(snr_value * 10000) / 10000
        snr_tuples.append((attribute_index, rounded_snr))

    sort.randomized_quick_sort_for_tuples(snr_tuples, 0, len(snr_tuples) - 1)

    progressbar.show(8,
                     progressbar_total,
                     prefix='Progress:',
                     suffix='Complete',
                     length=50)
def sort_by_standard_deviation():

    global data_matrix
    global ALL_count
    global snr_tuples
    global progressbar_total

    sample_length = len(data_matrix[0])
    sample_count = len(data_matrix)

    for attribute_index in range(1, sample_length):

        attribute_list = list()

        for sample_index in range(sample_count):
            attribute_list.append(data_matrix[sample_index][attribute_index])

        sd_value = statistics.standard_deviation(
            attribute_list[:ALL_count]) + statistics.standard_deviation(attribute_list[(ALL_count + 1):])
        rounded_sd = math.ceil(sd_value * 10000) / 10000
        snr_tuples.append((attribute_index, rounded_sd))

    sort.randomized_quick_sort_for_tuples(snr_tuples, 0, len(snr_tuples) - 1)

    progressbar.show(7, progressbar_total, prefix='Progress:',
                     suffix='Complete', length=50)