-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.py
69 lines (62 loc) · 1.63 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
"""Executor for the experiment."""
from argparse import ArgumentParser
from multiprocessing import cpu_count
import pandas as pd
from experiments import experiment
def main():
"""Run the experiment."""
parser = ArgumentParser(description="Run the experiment.")
parser.add_argument(
"--quantity",
type=int,
required=True,
help="The number of spectra to sample.",
)
parser.add_argument(
"--random-state",
type=int,
required=True,
help="The random state to use.",
)
parser.add_argument(
"--iterations",
type=int,
required=True,
help="The number of iterations to run.",
)
parser.add_argument(
"--output",
type=str,
required=True,
help="The output file to save the results to.",
)
parser.add_argument(
"--data-directory",
type=str,
required=True,
help="The directory to store the datasets in.",
)
parser.add_argument(
"--verbose",
action="store_true",
help="Whether to print additional information.",
)
parser.add_argument(
"--n-jobs",
type=int,
default=cpu_count(),
help="The number of jobs to use.",
)
args = parser.parse_args()
results: pd.DataFrame = experiment(
iterations=args.iterations,
quantity=args.quantity,
random_state=args.random_state,
directory=args.data_directory,
verbose=args.verbose,
n_jobs=args.n_jobs,
cache=True,
)
results.to_csv(args.output, index=False)
if __name__ == "__main__":
main()