This repository has been archived by the owner on Jun 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
/
main.py
73 lines (53 loc) · 3.24 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import click
from src.pipeline_manager import PipelineManager
pipeline_manager = PipelineManager()
@click.group()
def action():
pass
@action.command()
def prepare_metadata():
pipeline_manager.prepare_metadata()
@action.command()
def prepare_masks():
pipeline_manager.prepare_masks()
@action.command()
@click.option('-p', '--pipeline_name', help='pipeline to be trained', required=True)
@click.option('-v', '--validation_size', help='percentage of training used for validation', default=0.2, required=False)
@click.option('-d', '--dev_mode', help='if true only a small sample of data will be used', is_flag=True, required=False)
def train(pipeline_name, validation_size, dev_mode):
pipeline_manager.train(pipeline_name, validation_size, dev_mode)
@action.command()
@click.option('-p', '--pipeline_name', help='pipeline to be trained', required=True)
@click.option('-v', '--validation_size', help='percentage of training used for validation', default=0.2, type=str, required=False)
@click.option('-d', '--dev_mode', help='if true only a small sample of data will be used', is_flag=True, required=False)
def evaluate(pipeline_name, validation_size, dev_mode):
pipeline_manager.evaluate(pipeline_name, validation_size, dev_mode)
@action.command()
@click.option('-p', '--pipeline_name', help='pipeline to be trained', required=True)
@click.option('-d', '--dev_mode', help='if true only a small sample of data will be used', is_flag=True, required=False)
def predict(pipeline_name, dev_mode):
pipeline_manager.predict(pipeline_name, dev_mode)
@action.command()
@click.option('-p', '--pipeline_name', help='pipeline to be trained', required=True)
@click.option('-v', '--validation_size', help='percentage of training used for validation', default=0.1, required=False)
@click.option('-d', '--dev_mode', help='if true only a small sample of data will be used', is_flag=True, required=False)
def train_evaluate_predict(pipeline_name, validation_size, dev_mode):
pipeline_manager.train(pipeline_name, validation_size, dev_mode)
pipeline_manager.evaluate(pipeline_name, validation_size, dev_mode)
pipeline_manager.predict(pipeline_name, dev_mode)
@action.command()
@click.option('-p', '--pipeline_name', help='pipeline to be trained', required=True)
@click.option('-v', '--validation_size', help='percentage of training used for validation', default=0.1, required=False)
@click.option('-d', '--dev_mode', help='if true only a small sample of data will be used', is_flag=True, required=False)
def train_evaluate(pipeline_name, validation_size, dev_mode):
pipeline_manager.train(pipeline_name, validation_size, dev_mode)
pipeline_manager.evaluate(pipeline_name, validation_size, dev_mode)
@action.command()
@click.option('-p', '--pipeline_name', help='pipeline to be trained', required=True)
@click.option('-v', '--validation_size', help='percentage of training used for validation', default=0.1, required=False)
@click.option('-d', '--dev_mode', help='if true only a small sample of data will be used', is_flag=True, required=False)
def evaluate_predict(pipeline_name, validation_size, dev_mode):
pipeline_manager.evaluate(pipeline_name, validation_size, dev_mode)
pipeline_manager.predict(pipeline_name, dev_mode)
if __name__ == "__main__":
action()