-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_tests.py
49 lines (39 loc) · 1.61 KB
/
run_tests.py
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
# Author: Mubarak Abdu-Aguye <[email protected]>
# License: BSD-3-Clause
#This script runs the classifier scripts on the specified range of datasets, one by one
#It sets up the scaffold for the data and result folders beforehand
import os
import sys
from subprocess import run
startDataset = '50words'
endDataset = 'yoga'
prohibitedDatasets = []
pathToData = "./Data/"
pathToResults = "./Results/"
executableName = 'python3' if os.name == "posix" else "python"
n_runs = 10
classifierScripts = ['Hypothesis 3/rocket_classifier.py', 'Hypothesis 3/learning_shapelets.py']
if __name__ == "__main__":
if not os.path.isdir(pathToResults):
os.mkdir(pathToResults)
datasets = sorted(os.listdir(pathToData))
startIndex = datasets.index(startDataset)
endIndex = datasets.index(endDataset)
for i, d in enumerate(datasets):
if i < startIndex:
print('Seeking past dataset {}...'.format(d))
continue
if i > endIndex:
exit()
if d in prohibitedDatasets:
print('Skipping prohibited dataset {}..'.format(d))
continue
#now we're here. Construct the path to the dataset and bootstrap the classifier appropriately
datasetPath = os.path.join(pathToData,d)
print('Now processing {}..'.format(d))
for script in classifierScripts:
for n in range(n_runs):
print('\tRun {} of {} of {}..'.format(n + 1,n_runs,script))
run([executableName, script, d, pathToResults])
print('Completed runs for {}..'.format(script))
print('Fin')