def single_elaboration(total, max): total_list_average = [] total_list_std = [] total_list_generation = [] for experiment in total: gen = 0 list_average = [] list_std = [] list_generation = [] for generation in experiment[1]: lll = [] for el in generation: lll.append(float(el.replace(",", ""))) if len(lll) > 100: print("Be carefull, more than 100") list_average.append(np.average(np.array(lll))) list_std.append(np.std(np.array(lll))) list_generation.append(gen) gen += 1 total_list_average.append(list_average) total_list_std.append(list_std) total_list_generation.append(list_generation) total_list_average_maybe = [] total_list_std_maybe = [] for i in range(len(total_list_average[0])): list_appo = [] list_appo_two = [] for j in range(len(total_list_average)): list_appo.append(total_list_average[j][i]) list_appo_two.append(total_list_std[j][i]) total_list_average_maybe.append(np.average(np.array(list_appo))) total_list_std_maybe.append(np.average(np.array(list_appo_two))) scaled_version = [] for el in total_list_average_maybe: scaled_version.append((((el - 0) * (1 - 0)) / (max - 0)) + 0) # scaled_version.append(el) return scaled_version, total_list_generation[0]
def ext_cret(s0, s1, snew0, snew1): sX = deltn.iloc[:, s0:s1].T.values sY = deltn.iloc[:, snew0:snew1].T.values return (np.average([_cooc_dissim(sx,sy) for sx, sy in product(sX, sY)]) <= cooc_thresh) \ and getpercdel(s0, s1) > detectthresh and getpercret(s0, s1) > detectthresh
def _stretch_average(distance, stretches, indices): distmat = DataFrame(squareform(distance), index=indices, columns=indices) return np.array([ np.average(np.ravel(distmat.loc[si[0]:si[1] - 1, sj[0]:sj[1] - 1])) for si, sj in combinations(stretches, 2) ])
def ex_func(s0, s1, snew0, snew1): sX = nodeldf.loc[:, s0:s1 - 1].T.values sY = nodeldf.loc[:, snew0:snew1 - 1].T.values return (np.average([_spearman_dissim(sx,sy) for sx, sy in product(sX, sY)]) <= dissim_thresh) \ and vsgv_can_extend(min([s0,s1,snew0,snew1]), max(s0,s1,snew0,snew1), nodeldf, dense_perc, clip_quantile, fit_method, fit_interval, cache)