Skip to content

Commit

Permalink
added Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
ttimbers authored Jan 28, 2020
1 parent 997b7a7 commit 58eb063
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# breast cancer data pipe
# author: Tiffany Timbers
# date: 2020-01-17

all: results/final_model.rds results/accuracy_vs_k.png results/predictor_distributions_across_class.png results/final_model_quality.rds doc/breast_cancer_predict_report.md

# download data
data/raw/wdbc.feather: src/download_data.py
python src/download_data.py --out_type=feather --url=http://mlr.cs.umass.edu/ml/machine-learning-databases/breast-cancer-wisconsin/wdbc.data --out_file=data/raw/wdbc.feather

# pre-process data (e.g., scale and split into train & test)
data/processed/training.feather data/processed/test.feather scale_factor.rds: src/pre_process_wisc.r data/raw/wdbc.feather
Rscript src/pre_process_wisc.r --input=data/raw/wdbc.feather --out_dir=data/processed

# exploratory data analysis - visualize predictor distributions across classes
results/predictor_distributions_across_class.png: src/eda_wisc.r data/processed/training.feather
Rscript src/eda_wisc.r --train=data/processed/training.feather --out_dir=results

# tune model (here, find K for k-nn using 30 fold cv with Cohen's Kappa)
results/final_model.rds results/accuracy_vs_k.png: src/fit_breast_cancer_predict_model.r data/processed/training.feather
Rscript src/fit_breast_cancer_predict_model.r --train=data/processed/training.feather --out_dir=results

# test model on unseen data
results/final_model_quality.rds: src/breast_cancer_test_results.r data/processed/test.feather
Rscript src/breast_cancer_test_results.r --test=data/processed/test.feather --out_dir=results

# render report
doc/breast_cancer_predict_report.md: doc/breast_cancer_predict_report.Rmd doc/breast_cancer_refs.bib
Rscript -e "rmarkdown::render('doc/breast_cancer_predict_report.Rmd', output_format = 'github_document')"

clean:
rm -rf data
rm -rf results
rm -rf doc/breast_cancer_predict_report.md doc/breast_cancer_predict_report.html

0 comments on commit 58eb063

Please sign in to comment.