tensor_run[0, run, t_p] = tp_a[run * 1 + 0]

                tensor_run[1, run, f_p] = fp_b[run * 1 + 0]
                tensor_run[1, run, f_n] = fn_b[run * 1 + 0]
                tensor_run[1, run, t_p] = tp_b[run * 1 + 0]

            # print tensor_run

            new_n = 2
            new_tensor_run = tensor_run

            #new_n=3
            #new_tensor_run = tensor_run[[a,a,b],:,:]

            total_f, col_seq = select_by_round_robin(
                new_tensor_run,
                np.ones(new_n, dtype=int) * -1, [], [], new_n * 2, True)

            best_sum_total_f[
                d], best_col_seq[d] = select_by_estimated_max_f_impact(
                    new_tensor_run, np.ones(new_n, dtype=int), total_f,
                    col_seq, estimated_scores, future_steps,
                    True)  # Flight = 9, Blackoak 7, Hospital=5

        #print best_col_seq

        average_best = np.sum(best_sum_total_f.values(), axis=0) / float(
            len(best_sum_total_f))

        #print "a: " + str(error_fractions[a]) + " b: " + str(error_fractions[b]) + " -> " + str(list(average_best))
        print str(list(average_best))
Esempio n. 2
0
            for run in range(runs):
                for col in range(n):
                    tensor_run[col, run, f_p] = fp[col + n * run]
                    tensor_run[col, run, f_n] = fn[col + n * run]
                    tensor_run[col, run, t_p] = tp[col + n * run]


            # print tensor_run

            new_n=2
            new_tensor_run = tensor_run[[a,b],:,:]

            #new_n=3
            #new_tensor_run = tensor_run[[a,a,b],:,:]

            best_sum_total_f[d], best_col_seq[d] = select_by_round_robin(new_tensor_run, np.ones(new_n, dtype=int) * -1, [], [], future_steps, True) #Flight = 9, Blackoak 7, Hospital=5

        #print best_col_seq


        average_best = np.sum(best_sum_total_f.values(), axis=0) / float(len(best_sum_total_f))

        #print "a: " + str(error_fractions[a]) + " b: " + str(error_fractions[b]) + " -> " + str(list(average_best))
        print str(list(average_best))
'''
labels = []

start = 0
for ii in range(new_n):
    start +=4
    labels.append(start)