-
Notifications
You must be signed in to change notification settings - Fork 10
/
run.py
32 lines (24 loc) · 881 Bytes
/
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
import d6tflow
import cfg, tasks, visualize
# Check task dependencies and their execution status
flow = d6tflow.Workflow(task=tasks.TaskTrain)
flow.preview()
# Execute the model training task including dependencies. See https://d6tflow.readthedocs.io/en/latest/run.html
flow.run()
# use output
visualize.accuracy()
visualize.plot_importances()
# change parameter and rerun, see https://d6tflow.readthedocs.io/en/latest/advparam.html
params = dict(do_preprocess=False)
flow1 = d6tflow.Workflow(params=params, task=tasks.TaskTrain)
flow1.run()
visualize.accuracy(do_preprocess=False) # task output is parameter specific
# rerun flow after code changes
import importlib
importlib.reload(cfg)
importlib.reload(tasks)
# say you changed TaskGetData, reset all tasks depending on TaskGetData
flow.reset(tasks.TaskGetData)
flow1.reset(tasks.TaskGetData)
flow.preview()
flow.run()