Sleds/scorewalker-utils/TreeWalker/tmp.py

27 lines
992 B
Python

import os
import TreeWalker
root_dir = r'C:\Users\chris\Documents\Code\Tests\KMeans\L3Results\2017.10.17\17.49'
test_in = r'C:\Users\chris\Documents\Code\Tests\KMeans\Test-Input-2017.10.12\Test-Files'
folders = [os.path.join(root_dir, f) for f in os.listdir(root_dir)]
folders = [os.path.split(f)[1] for f in folders if os.path.isdir(f)]
for folder in folders:
if 'index' in folder.lower() or 'logs' in folder.lower() or 'programs' in folder.lower():
continue
clux_output = os.path.join(test_in, '%s_true.json' % folder)
folder = os.path.join(root_dir, folder)
class_output = os.path.join(folder, 'classification-results.json')
tree_output = os.path.join(folder, 'classification-analysis.csv')
print('\nComparing CLUX data to classification data')
print(' CLUX file: %s' % clux_output)
print(' Classification file: %s' % class_output)
print('Saving result to %s' % tree_output)
TreeWalker.main(clux_output, class_output, tree_output)