forked from UBC-MDS/Wine_Quality_Predictor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (35 loc) · 2.37 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
# Wine Quality Predictor (makefile)
# author: Group 33
# date: 2020-12-04
# This driver script completes the analysis on wine quality and generate
# a model for wine quality predictor and corresponding report.
# It takes no arguments.
# example usage:
# make all
# all: results/best_Model.pkl results/final_model_quality.png reports/reports.md
all: results/wine_quality_rank_per_feature.svg results/final_model_quality.png reports/reports.md
# download wine data set to directory
data/raw/winequality-red.csv: src/download_data.py
python src/download_data.py --url="https://archive.ics.uci.edu/ml/machine-learning-databases/wine-quality/winequality-red.csv" --out_file="data/raw/winequality-red.csv"
data/raw/winequality-white.csv: src/download_data.py
python src/download_data.py --url="https://archive.ics.uci.edu/ml/machine-learning-databases/wine-quality/winequality-white.csv" --out_file="data/raw/winequality-white.csv"
# pre-process data and split data to training set and test set
data/processed/processed.csv data/processed/processed_test.csv data/processed/processed_train.csv: src/pre_processing_wine.py data/raw/winequality-red.csv data/raw/winequality-white.csv
python src/pre_processing_wine.py --in_file_1="data/raw/winequality-red.csv" --in_file_2="data/raw/winequality-white.csv" --out_dir="data/processed/"
# create exploratory data analysis figure and write to file
results/wine_quality_rank_per_feature.svg: eda/wine_eda.py data/processed/processed.csv
python eda/wine_eda.py -i data/processed/processed.csv -o eda/wine_EDA_files/
# fitting model
results/best_Model.pkl: src/fit_wine_quality_predict_model.py data/processed/processed_train.csv
python src/fit_wine_quality_predict_model.py --in_file_1="data/processed/processed_train.csv" --out_dir="results/"
# test model
results/final_model_quality.png: src/wine_quality_test_results.py data/processed/processed_train.csv data/processed/processed_test.csv results/best_Model.pkl
python src/wine_quality_test_results.py --in_file_1="data/processed/processed_train.csv" --in_file_2="data/processed/processed_test.csv" --out_dir="results/"
# render final report
reports/reports.md: reports/reports.Rmd reports/wine_refs.bib
Rscript -e "rmarkdown::render('reports/reports.Rmd', output_format = 'github_document')"
clean:
rm -rf data
rm eda/wine_EDA_files/wine_quality_rank_per_feature.svg
rm -rf results
rm reports/reports.md