示例#1
0
total_errors = pd.DataFrame()
mean_ratio_errors = pd.DataFrame()
max_ratio_errors = pd.DataFrame()
min_ratio_errors = pd.DataFrame()
max_distances = pd.DataFrame()
min_distances = pd.DataFrame()
gini_coefficients = pd.DataFrame()
mean_idenratio_errors = pd.DataFrame()
max_idenratio_errors = pd.DataFrame()
min_idenratio_errors = pd.DataFrame()
iden_gini_coefficients = pd.DataFrame()
for i in range(t):
    print(i, flush=True)
    k = np.random.randint(2, k_max + 1)
    ks.append(k)
    Ws, Wn, As = workload_selection(W_lst, W_name, A_lst, n, k, rep)
    res = error_calc(Ws, Ws, n, eps, modes, rep, As=As, Ar=As)
    results.append(res)
    names.append(Wn)
    total_error = OrderedDict()
    mean_ratio_error = OrderedDict()
    max_ratio_error = OrderedDict()
    min_ratio_error = OrderedDict()
    max_distance = OrderedDict()
    min_distance = OrderedDict()
    gini_coefficient = OrderedDict()
    mean_idenratio_error = OrderedDict()
    max_idenratio_error = OrderedDict()
    min_idenratio_error = OrderedDict()
    iden_gini_coefficient = OrderedDict()
    for mode in modes:
示例#2
0
results = []
names = []
ks = []
total_errors = pd.DataFrame()
max_ratio_errors = pd.DataFrame()
inters = pd.DataFrame()

for i in range(t):
    print(i, flush=True)
    k = np.random.randint(2, k_max + 1)
    ks.append(k)
    Ws, Wn, As = workload_selection(W_lst,
                                    W_name,
                                    A_lst,
                                    n,
                                    k,
                                    rep,
                                    types=types,
                                    prob=0.8)
    error_base, total_error, max_ratio_error, inter = interference_custom(
        Ws, As, n, eps, modes, rep)
    results.append(error_base)
    names.append(Wn)
    total_errors = pd.concat(
        [total_errors, pd.DataFrame(total_error, index=[i])])
    max_ratio_errors = pd.concat(
        [max_ratio_errors,
         pd.DataFrame(max_ratio_error, index=[i])])
    inters = pd.concat([inters, pd.DataFrame(inter, index=[i])])

names = np.asarray(names)