Skip to content
Snippets Groups Projects
Commit 93ed2c42 authored by Pierre LOTTE's avatar Pierre LOTTE
Browse files

Fix timer

parent 6a56aea4
Branches
Tags
No related merge requests found
...@@ -149,7 +149,7 @@ if __name__ == "__main__": ...@@ -149,7 +149,7 @@ if __name__ == "__main__":
algo_params = json.load(f) algo_params = json.load(f)
with open(f"{INPUT_DIR}/{config_name}/time.csv", "a", encoding="utf-8") as f: with open(f"{INPUT_DIR}/{config_name}/time.csv", "a", encoding="utf-8") as f:
f.write("Algorithm,dataset,duration") f.write("Algorithm,dataset,duration\n")
for algo in args.algorithms: for algo in args.algorithms:
params = algo_params[algo] params = algo_params[algo]
......
...@@ -82,7 +82,7 @@ class BaseSplitter: ...@@ -82,7 +82,7 @@ class BaseSplitter:
Compute the vector of correlation coefficients for each of the variable of the dataset. Compute the vector of correlation coefficients for each of the variable of the dataset.
""" """
with open(f"{self.data_path}/split_time.csv", "a", encoding="utf-8") as f: with open(f"{self.data_path}/split_time.csv", "a", encoding="utf-8") as f:
f.write("Algorithm,duration") f.write("Algorithm,duration\n")
x = None x = None
for coeff in CORRELATION_CLASSES: for coeff in CORRELATION_CLASSES:
coeff_name = coeff.__name__[:-11] coeff_name = coeff.__name__[:-11]
...@@ -90,7 +90,7 @@ class BaseSplitter: ...@@ -90,7 +90,7 @@ class BaseSplitter:
start_time = time() start_time = time()
correlation_matrix = coeff().compute(data) correlation_matrix = coeff().compute(data)
duration = time() - start_time duration = time() - start_time
f.write(f"{coeff_name},{duration}") f.write(f"{coeff_name},{duration}\n")
correlation_matrix.to_csv(f"{self.data_path}/dataset_correlation_{coeff_name}.csv") correlation_matrix.to_csv(f"{self.data_path}/dataset_correlation_{coeff_name}.csv")
sns.heatmap(correlation_matrix, annot=True, cmap="coolwarm")\ sns.heatmap(correlation_matrix, annot=True, cmap="coolwarm")\
......
...@@ -66,4 +66,4 @@ class BaseTrainer(): ...@@ -66,4 +66,4 @@ class BaseTrainer():
duration = time() - start_time duration = time() - start_time
with open(f"{path}/time.csv", "a", encoding="utf-8") as f: with open(f"{path}/time.csv", "a", encoding="utf-8") as f:
f.write(f"{self.algorithm},{file_name},{duration}") f.write(f"{self.algorithm},{file_name},{duration}\n")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment