-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli_app.py
More file actions
75 lines (52 loc) · 1.45 KB
/
cli_app.py
File metadata and controls
75 lines (52 loc) · 1.45 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import typer
from app.actions.model import train_model_and_save_model_xgboost, train_model_and_save_model_gradient
from app.actions.predictions import predict_from_json, fill_win_column, predictions_stats
from app.actions.scrape import scrape_seasons, scrape_team_seasons
from app.actions.db_operations import fill_data_to_db
from app.actions.model import backtest
app = typer.Typer()
@app.command()
def train_xgb():
"""Train the model."""
train_model_and_save_model_xgboost()
@app.command()
def train_gradient():
"""Train the model."""
train_model_and_save_model_gradient()
@app.command()
def predict_all():
"""Run all predictions."""
predict_from_json('mean')
predict_from_json('trend')
@app.command()
def predict_mean():
"""Run mean prediction."""
predict_from_json('mean')
@app.command()
def predict_trend():
"""Run trend prediction."""
predict_from_json('trend')
@app.command()
def scrape_init():
"""Scrape data."""
scrape_seasons()
scrape_team_seasons()
@app.command()
def fill_predictions():
"""Fill predictions table."""
fill_win_column()
predictions_stats()
@app.command()
def get_predictions_stats():
"""Generate prediction statistics."""
predictions_stats()
@app.command()
def fill_data():
"""Fill data to the database."""
fill_data_to_db()
@app.command()
def backtest_predictions():
"""Run backtesting."""
backtest()
if __name__ == "__main__":
app()