-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
65 lines (53 loc) · 2.92 KB
/
makefile
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
# Makefile
# Jay mangat, dec 2024
# This driver script creates a report of
# the shooting habits of NHL players and performs a analysis
# on whether a player's body composition influences their shooting hand.
# This script takes no arguments.
# example usage:
# make all
.PHONY: all clean
# run entire analysis
all: report/shooting_hand_predictor.html report/shooting_hand_predictor.pdf
data/raw/nhl_rosters.csv : scripts/download_data.py
python scripts/download_data.py \
--url="https://raw.githubusercontent.com/rfordatascience/tidytuesday/refs/heads/main/data/2024/2024-01-09/nhl_rosters.csv" \
--write_to=data/raw
data/processed/roster_train.csv data/processed/roster_test.csv results/models/roster_preprocessor.pickle: scripts/preprocess_and_validate.py data/raw/nhl_rosters.csv
python scripts/preprocess_and_validate.py \
--raw-data=data/raw/nhl_rosters.csv \
--data-to=data/processed \
--preprocessor-to=results/models
results/figures/player_height_weight_distribution.png results/figures/confusion_matrix.png results/tables/df_describe.csv results/tables/df_head.csv results/tables/df_info.csv: scripts/eda.py data/processed/roster_train.csv data/processed/roster_test.csv results/models/roster_preprocessor.pickle
python scripts/eda.py \
--processed-training-data=data/processed/roster_train.csv \
--tables-to=results/tables \
--plot-to=results/figures \
results/figures/confusion_matrix.png results/tables/test_scores.csv results/models/shooter_pipeline.pickle: scripts/shooting_hand_classifier.py results/figures/player_height_weight_distribution.png results/figures/confusion_matrix.png results/tables/df_describe.csv results/tables/df_head.csv results/tables/df_info.csv
python scripts/shooting_hand_classifier.py \
--training-data=data/processed/roster_train.csv \
--test-data=data/processed/roster_test.csv \
--preprocessor=results/models/roster_preprocessor.pickle \
--pipeline-to=results/models \
--plot-to=results/figures \
--results-to=results/tables
# write the report
report/shooting_hand_predictor.html report/shooting_hand_predictor.pdf: report/shooting_hand_predictor.qmd results/figures/confusion_matrix.png results/tables/test_scores.csv results/models/shooter_pipeline.pickle report/references.bib
quarto render report/shooting_hand_predictor.qmd --to html
quarto render report/shooting_hand_predictor.qmd --to pdf
clean :
rm -f data/raw/nhl_rosters.csv \
data/processed/roster_train.csv \
data/processed/roster_test.csv \
results/models/roster_preprocessor.pickle \
results/figures/player_height_weight_distribution.png \
results/figures/confusion_matrix.png \
results/tables/df_describe.csv \
results/tables/df_head.csv \
results/tables/df_info.csv \
results/figures/confusion_matrix.png \
results/tables/test_scores.csv \
results/models/shooter_pipeline.pickle \
rm -rf report/shooting_hand_predictor.pdf \
report/shooting_hand_predictor.html \
report/shooting_hand_predictor_files