<commit_before>
# Variables
credit = data/Credit.csv
quant = eda-quantitative-script.R
qual = qualitative-script.R
mse = code/functions/mse-function.R
clean_data = data/data/train-and-test-set.RData
ols = ols-regression-script.R
ridge = ridge-regression-script.R
lasso = lasso-regression-script.R
pcr = PCR-script.R
plsr = PLSR-script.R
sections = report/sections/*.Rmd

#declare phony targets
.PHONY: all data tests eda pre ols ridge lasso pcr plsr regressions report slides session clean

# ------------------------------------------------------------------------------------------
# default targets
# ------------------------------------------------------------------------------------------
all: eda regressions report


# ------------------------------------------------------------------------------------------
# download data
# ------------------------------------------------------------------------------------------
data:
	curl "http://www-bcf.usc.edu/~gareth/ISL/Credit.csv" > $(credit)


# ------------------------------------------------------------------------------------------
# unit tests
# ------------------------------------------------------------------------------------------
tests: code/test-that.R code/functions/mse-function.R
	cd code && Rscript test-that.R


# ------------------------------------------------------------------------------------------
# run eda-qualitative-script.R and eda-quantitative-script.R
# ------------------------------------------------------------------------------------------
eda: code/scripts/$(qual) code/scripts/$(quant) $(credit)
	cd code/scripts && Rscript $(qual)
	cd code/scripts && Rscript $(quant)


# ------------------------------------------------------------------------------------------
# pre-process data
# ------------------------------------------------------------------------------------------
pre: code/scripts/pre-process-script.R $(credit)
	cd code/scripts && Rscript pre-process-script.R


# ------------------------------------------------------------------------------------------
# run OLS regression
# ------------------------------------------------------------------------------------------
ols: code/scripts/$(ols) $(clean_data) $(mse)
	cd code/scripts && Rscript $(ols)


# ------------------------------------------------------------------------------------------
# run ridge regression
# ------------------------------------------------------------------------------------------
ridge: code/scripts/$(ridge) $(clean_data) $(mse)
	cd code/scripts && Rscript $(ridge)


# ------------------------------------------------------------------------------------------
# run lasso regression
# ------------------------------------------------------------------------------------------
lasso: code/scripts/$(lasso) $(clean_data) $(mse)
	cd code/scripts && Rscript $(lasso)	


# ------------------------------------------------------------------------------------------
# run PCR regression
# ------------------------------------------------------------------------------------------
pcr: code/scripts/$(pcr) $(clean_data) $(mse)
	cd code/scripts && Rscript $(pcr)


# ------------------------------------------------------------------------------------------
# run PLSR regression
# ------------------------------------------------------------------------------------------
plsr: code/scripts/$(plsr) $(clean_data) $(mse)
	cd code/scripts && Rscript $(plsr)


# ------------------------------------------------------------------------------------------
# run all five types of regressions
# ------------------------------------------------------------------------------------------
regressions: ols ridge lasso pcr plsr


# ------------------------------------------------------------------------------------------
# generate Rmd and PDF report
# ------------------------------------------------------------------------------------------
report: $(md) $(clean_data) $(mse)
	cat $(md) > report/report.Rmd
	cd report && Rscript -e 'library(rmarkdown); render("report.Rmd")'


# ------------------------------------------------------------------------------------------
# generate slides.html
# ------------------------------------------------------------------------------------------




# ------------------------------------------------------------------------------------------
# generate session-info.txt
# ------------------------------------------------------------------------------------------
session-info: code/scripts/session-info-script.R
	cd code/scripts/ && Rscript session-info-script.R
	

# ------------------------------------------------------------------------------------------
# clean the target
# ------------------------------------------------------------------------------------------
clean:
	rm -f report/report.pdf 
<commit_msg>Modified Makefile: added slides target<commit_after>
# Variables
credit = data/Credit.csv
quant = eda-quantitative-script.R
qual = qualitative-script.R
mse = code/functions/mse-function.R
clean_data = data/train-and-test-set.RData
ols = ols-regression-script.R
ridge = ridge-regression-script.R
lasso = lasso-regression-script.R
pcr = PCR-script.R
plsr = PLSR-script.R
sections = report/sections/*.Rmd

#declare phony targets
.PHONY: all data tests eda pre ols ridge lasso pcr plsr regressions report slides session clean

# ------------------------------------------------------------------------------------------
# default targets
# ------------------------------------------------------------------------------------------
all: eda regressions report


# ------------------------------------------------------------------------------------------
# download data
# ------------------------------------------------------------------------------------------
data:
	curl "http://www-bcf.usc.edu/~gareth/ISL/Credit.csv" > $(credit)


# ------------------------------------------------------------------------------------------
# unit tests
# ------------------------------------------------------------------------------------------
tests: code/test-that.R code/functions/mse-function.R
	cd code && Rscript test-that.R


# ------------------------------------------------------------------------------------------
# run eda-qualitative-script.R and eda-quantitative-script.R
# ------------------------------------------------------------------------------------------
eda: code/scripts/$(qual) code/scripts/$(quant) $(credit)
	cd code/scripts && Rscript $(qual)
	cd code/scripts && Rscript $(quant)


# ------------------------------------------------------------------------------------------
# pre-process data
# ------------------------------------------------------------------------------------------
pre: code/scripts/pre-process-script.R $(credit)
	cd code/scripts && Rscript pre-process-script.R


# ------------------------------------------------------------------------------------------
# run OLS regression
# ------------------------------------------------------------------------------------------
ols: code/scripts/$(ols) $(clean_data) $(mse)
	cd code/scripts && Rscript $(ols)


# ------------------------------------------------------------------------------------------
# run ridge regression
# ------------------------------------------------------------------------------------------
ridge: code/scripts/$(ridge) $(clean_data) $(mse)
	cd code/scripts && Rscript $(ridge)


# ------------------------------------------------------------------------------------------
# run lasso regression
# ------------------------------------------------------------------------------------------
lasso: code/scripts/$(lasso) $(clean_data) $(mse)
	cd code/scripts && Rscript $(lasso)	


# ------------------------------------------------------------------------------------------
# run PCR regression
# ------------------------------------------------------------------------------------------
pcr: code/scripts/$(pcr) $(clean_data) $(mse)
	cd code/scripts && Rscript $(pcr)


# ------------------------------------------------------------------------------------------
# run PLSR regression
# ------------------------------------------------------------------------------------------
plsr: code/scripts/$(plsr) $(clean_data) $(mse)
	cd code/scripts && Rscript $(plsr)


# ------------------------------------------------------------------------------------------
# run all five types of regressions
# ------------------------------------------------------------------------------------------
regressions: ols ridge lasso pcr plsr


# ------------------------------------------------------------------------------------------
# generate Rmd and PDF report
# ------------------------------------------------------------------------------------------
report: $(sections) $(clean_data) $(mse)
	cat $(sections) > report/report.Rmd



# ------------------------------------------------------------------------------------------
# Rmd to HTML slides
# ------------------------------------------------------------------------------------------
slides: $(clean_data) $(mse)
	cd slides && Rscript -e 'library(rmarkdown); render("predictive-modeling-slides.Rmd")'


# ------------------------------------------------------------------------------------------
# generate session-info.txt
# ------------------------------------------------------------------------------------------
session-info: code/scripts/session-info-script.R
	cd code/scripts/ && Rscript session-info-script.R
	

# ------------------------------------------------------------------------------------------
# clean the target
# ------------------------------------------------------------------------------------------
clean:
	rm -f report/report.pdf 

{'fraction_non_alphanumeric': 0.6194381792085298, 'fraction_numerical': 0.0, 'mean_word_length': 0.5462038357901411, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6210291', 'n_tokens_mistral': 1731, 'n_tokens_neox': 1638, 'n_words': 391}