-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEXP_REAL_DATA.py
More file actions
50 lines (41 loc) · 1.5 KB
/
Copy pathEXP_REAL_DATA.py
File metadata and controls
50 lines (41 loc) · 1.5 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
45
46
47
48
49
50
import multiprocessing
import pathlib as pathlib
import time
from pipeline.helpers.arg_parsers import get_real_data_arg_parser
from pipeline.helpers.data_loaders import DATASETS, load
from pipeline.helpers.misc import build_real_data_name
from pipeline.pipeline import Pipeline
if __name__ == "__main__":
args = get_real_data_arg_parser()
# Freezing support for multiprocessing
multiprocessing.freeze_support()
if args.dataset == "custom":
data = load(args.data_path)
else:
data = DATASETS[args.dataset]["load"]()
pipeline_name = build_real_data_name(args.dataset, args.gen_func, args.params)
pipeline = Pipeline(
model_name=args.model,
params_name=args.params,
data=data,
freq=DATASETS[args.dataset]["freq"],
pipeline_name=pipeline_name,
base_dir_name=pathlib.Path(__file__).parent.absolute(),
df_name=args.dataset
)
# kwargs could contain:
# scalers,
# scaling_levels,
# weighted_loss,
# norm_types,
# norm_modes,
# norm_affines,
# e.g. kwargs = {"scalers": [StandardScaler()], "scaling_levels": ["per_time_series"]}
kwargs = {}
start_time = time.time()
pipeline.run(
save=True, test_percentage=0.25, params_generator_name=args.gen_func, with_scalers=args.with_scalers, **kwargs
)
end_time = time.time()
print("Pipeline execution time: ", end_time - start_time)
pipeline.summary()