-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (54 loc) · 2.12 KB
/
train-spread-predictor.yaml
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
name: NFL Spread Predictor Pipeline
on:
# schedule:
# - cron: '0 0 * * 2'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.7.1
- name: Install dependencies with Poetry
run: poetry install
- name: Download data
run: poetry run python ./nfl_analytics/main.py --download
# Necessary for train step
# https://github.com/actions/runner-images/discussions/7188#discussioncomment-6750749
# https://stackoverflow.com/questions/71590851/r8-is-causing-gradle-daemon-to-vanish-on-github-hosted-action-runner/76921482#76921482
- name: Increase swapfile
run: |
df -h
sudo swapoff -a
sudo fallocate -l 12G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon --show
# Seperated from Download data to make debugging easier
- name: Train Model
run: poetry run python ./nfl_analytics/main.py --train
- name: Create release
id: create_release
uses: softprops/action-gh-release@v1
with:
files: ./nfl_analytics/assets/*
tag_name: spread-predictor
draft: true
body: |
This release includes the trained model, scaler, and compressed CSV file needed for predictions:
The machine learning model saved using joblib.
- **trained_model-[timstamp].joblib:** The scaler pickled with joblib for scaling matchup inputs.
- **trained_scaler-[timstamp].joblib:** The scaler pickled with joblib for scaling matchup inputs.
- **running_average-[timstamp].csv.gz:** Running averages used to form matchup inputs
To make predictions, use these with the main.py --predict command on asset sets with matching timestamps.