-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.py
37 lines (28 loc) · 1.01 KB
/
run.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
from helpers import load_adatas, scatter_and_line
from dimred import run_method
import matplotlib.pyplot as plt
def run_all(methods_list):
adatas_list = load_adatas("./h5ad")
times_dict = {method: {} for method in methods_list}
memory_dict = {method: {} for method in methods_list}
for i, adata in enumerate(adatas_list):
print(i)
for method in methods_list:
adata, time_mes, memory = run_method(adata, method)
times_dict[method][adata.n_obs] = time_mes
memory_dict[method][adata.n_obs] = memory
plt.show()
return times_dict, memory_dict, adatas_list
methods = ["PHATE", "UMAP"]
times, memory, adatas = run_all(methods)
regression_degree = 2
for method in methods:
scatter_and_line(times[method], method, regression_degree)
plt.show()
for method in methods:
scatter_and_line(memory[method], method, regression_degree)
plt.show()
# times_new.sort_index(inplace=True)
"""for col in times_new.columns:
plt.plot(times_new[col])
plt.show() """