-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
47 lines (44 loc) · 1.6 KB
/
main.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
import hydra
from omegaconf import DictConfig
from pathlib import Path
from typing import Union
from src.train import run_study, view_study, train_w_best_params, test
from src.partitions import create_partitions
from src.inference import daily_prediction, range_prediction
from src.plots import optuna_plots, nn_confusion_calendar, first_confusion_calendar, confusion_calendar_patches
from src.explain import explain
from src.partitions import preprocessing
import pandas as pd
@hydra.main(config_path="conf", config_name="config")
def main(cfg: DictConfig) -> None:
action = cfg.action
if action == "create_partitions":
create_partitions(cfg)
elif action == "run_study": # if modified input features, we need to create partitions again before running this!
run_study(cfg)
elif action == "view_study":
view_study(cfg)
elif action == "train_w_best_params":
train_w_best_params(cfg)
elif action == "test":
test(cfg)
elif action == "daily_prediction":
daily_prediction(cfg)
elif action == "range_prediction":
range_prediction(cfg)
elif action == "explain":
explain(cfg)
elif action == "optuna_plots":
optuna_plots(cfg)
elif action == "preprocessing":
preprocessing(cfg)
elif action == "nn_confusion_calendar":
nn_confusion_calendar(cfg)
elif action == "first_confusion_calendar":
first_confusion_calendar(cfg)
elif action == "confusion_calendar_patches":
confusion_calendar_patches()
else:
raise ValueError("Action not implemented.")
if __name__ == "__main__":
main()