-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
44 lines (38 loc) · 1.32 KB
/
main.py
File metadata and controls
44 lines (38 loc) · 1.32 KB
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
"""
Entry point for program
"""
import sys
import warnings
from matplotlib import rcParams
from src.datasets.gen_voxels import generate
from src.fitting.fit_models import fit_all_models
from src.machine_learning.entry import train_and_evaluate_all_datasets
from src.visualisation.entry import visualisation_entry
def warn(*args, **kwargs):
#pylint: disable=unused-argument
"""Overrides deprecation warning from scikit-learn"""
pass
warnings.warn = warn
def usage():
"""Prints usage information for the program"""
print "python main.py <CMD> where <CMD> is one of"
print " generate -- to generate data"
print " train-all -- to train all models using generated data"
print " visualise -- to generate aggregate visualisations"
print "Models can be configured in src/config.py; compartment names"
print "must match those in camino_compartments, which is defined in the same file"
if __name__ == "__main__":
rcParams.update({'figure.autolayout': True})
if len(sys.argv) < 2:
usage()
CMD = sys.argv[1]
if CMD == "generate":
generate()
elif CMD == "fit-all":
fit_all_models()
elif CMD == "train-all":
train_and_evaluate_all_datasets()
elif CMD == "visualise":
visualisation_entry()
else:
usage()