############################################################################# ## ## File: Makefile ## Date Created: 2006-03-20 ## ## Copyright (c) 2006 David D. Allen ## ## Permission is hereby granted, free of charge, to any person obtaining a ## copy of this software and associated documentation files (the "Software"), ## to deal in the Software without restriction, including without limitation ## the rights to use, copy, modify, merge, publish, distribute, sublicense, ## and/or sell copies of the Software, and to permit persons to whom the ## Software is furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included in ## all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ## IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ## FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ## DEALINGS IN THE SOFTWARE. ## ############################################################################# ### #---------------------------------------------------------------------- setup # constants for processing pdThreshold = 0.8 zThresh = -4.2645 # P = 0.00001 minTrainingSize = 300 maxTrainingSize = 3000 minTestSize = 600 maxTestSize = 3000 testRepeats = 10 eraSize = 150 texOutput = stats-table.tex texStatsLabel = "Results from modified Sawtooth." texStatsId = "tab:FinalStats" # directories for data rawArffDir = ../../../../var/tmp arffDir = ../../../../var/tmp/data/filtered-data testingDir = ../../../../var/tmp/data/test-data testResultsDir = ../../../../var/tmp/data/test-results finalStatsDir = ../../../../var/tmp/data/final-stats texOutputDir = ../../../../var/tmp/data/tex-output # list of source arff files rawDataSources = $(wildcard $(rawArffDir)/*.arff ) filteredDataSources = $(wildcard $(arffDir)/*.arff ) trainDataSources = $(wildcard $(testingDir)/*-train.arff ) # list of arff files after filtering dataSources = $(rawDataSources:$(rawArffDir)/%.arff=$(arffDir)/%.arff) # list of csv files for testing set data testCsv = $(filteredDataSources:$(arffDir)/%.arff=$(testingDir)/%.csv) # list of csv files after testing #resultsCsv = \ #$(trainDataSources:$(testingDir)/%-train.arff=$(testResultsDir)/%.csv) # list of csv files for class stats classStatsCsv = $(testCsv:$(testingDir)/%.csv=$(finalStatsDir)/%.csv) #------------------------------------------------------------- implicit rules # filter raw data to filtered data $(arffDir)/%.arff: $(rawArffDir)/%.arff ./code/filter.pl @echo -e "filter \"$<\" \"$@\"" @./code/filter.pl $< $@ $(pdThreshold) # resample filtered data to create training and testing data sets $(testingDir)/%.csv: $(arffDir)/%.arff ./code/resample.pl @echo -e "resample \"$<\" \"$@\"" @./code/resample.pl $< $(testingDir) $(minTrainingSize) \ $(maxTrainingSize) $(minTestSize) $(maxTestSize) $(testRepeats) # run SAWTOOTH on all training and test data $(testResultsDir)/%.csv: $(testingDir)/%-train.arff ./code/sawtooth.awk @echo -e "SAWTOOTH \"$<\" \"$(testingDir)/$*--test.arff\" \"$@\"" @gawk -f ./code/sawtooth.awk ERA=$(eraSize) Verbose=0 Brief=0 \ SUBBINS=5 Pass=1 zThresh=$(zThresh) \ $< Pass=2 $(testingDir)/$*--test.arff > $@ # summarize data set results into final stats $(finalStatsDir)/%.csv: $(testingDir)/%.csv #./code/classStats.pl @echo -e "classStats \"$<\" \"$(testResultsDir)\" \"$@\"" @./code/classStats.pl $< $(testResultsDir) $@ $(eraSize) #------------------------------------------------------- explicit build rules .PHONY : tex-output class-stats perform-test resample-data filter-data \ clean-all clean-tex clean-stats clean-test clean-resample \ clean-filter # produce the final tex output table tex-output : $(texOutputDir)/$(texOutput) # calculate class stats from the test results class-stats : $(classStatsCsv) # run the modified SAWTOOTH to produce final results perform-test : #$(resultsCsv) @echo -e "SAWTOOTH \"$<\" \"$(testingDir)/$%--test.arff\" \"$@\"" @gawk -f ./code/sawtooth.awk ERA=$(eraSize) Verbose=0 Brief=0 \ SUBBINS=5 Pass=1 zThresh=$(zThresh) \ $< Pass=2 $(testingDir)/$%--test.arff > $@ # resamples the filtered data into the testing data folder resample-data : $(testCsv) # filters the raw data into the filtered data folder filter-data : $(dataSources) # produce the final tex output table $(texOutputDir)/$(texOutput) : ./code/build-tex-stats-table.pl ./code/build-tex-stats-table.pl $(finalStatsDir) \ $(texStatsLabel) $(texStatsId) "$@" #------------------------------------------------------- explicit clean rules # remove all generated files clean-all: clean-filter # remove all tex output clean-tex: rm -f $(texOutputDir)/*.tex # remove all class stats clean-stats: clean-tex rm -f $(finalStatsDir)/*.csv # remove all test created files clean-test: clean-stats rm -f $(testResultsDir)/*.csv # remove all resample created files clean-resample: clean-test rm -f $(testingDir)/*.arff rm -f $(testingDir)/*.csv # remove all filter created files clean-filter: clean-resample rm -f $(arffDir)/*.arff