Skip to content

Instantly share code, notes, and snippets.

@FlukeAndFeather
Last active April 16, 2024 18:52
Show Gist options
  • Save FlukeAndFeather/8ade23a5b8ec8294ae916299e5a9fbae to your computer and use it in GitHub Desktop.
Save FlukeAndFeather/8ade23a5b8ec8294ae916299e5a9fbae to your computer and use it in GitHub Desktop.
# Make the whole analysis
# The prequisite for all is the end of your pipeline (in this case, your model predictions)
.PHONY: all
all: models/predictions.pkl
# You can preview the sequence of commands in the pipeline with: make all -B --recon
# I recommend putting that in your README
# 1. Download raw data
### replace species.csv, species2.csv, etc with names of your raw data files
### the ampersand-colon &: tells make that this rule has multiple grouped targets
data/raw/species.csv data/raw/species2.csv &:
# replace this with something like: python src/data/download_data.py
wget -O data/raw/species.csv https://figshare.com/ndownloader/files/3299483
wget -O data/raw/species2.csv https://figshare.com/ndownloader/files/3299483
# 2. Process data
data/processed/features.csv: data/raw/species.csv
python src/features/generate_features.py
# 3. Fit model
models/simple_features.pkl: data/processed/features.csv
python src/models/train_model.py
# 4. Predict
models/predictions.pkl: models/simple_features.pkl
python src/models/predict_model.py
# Utilities
# clean up
.PHONY: clean
clean:
rm -rf data/raw/*
# notebook
notebook:
jupyter notebook
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment