def new_self_comparisons():
    outcomparisons = '../measuredivergence/results/self_comparisons.tsv'
    columns = ['testype', 'name1', 'name2', 'ratio', 'spearman', 'spear1on2', 'spear2on1', 'loss', 'loss1on2', 'loss2on1', 'acc1', 'acc2', 'alienacc1', 'alienacc2', 'meandate1', 'meandate2']
    if (not os.path.isfile(outcomparisons)):
        with open(outcomparisons, mode='a', encoding='utf-8') as f:
            scribe = csv.DictWriter(f, delimiter='\t', fieldnames=columns)
            scribe.writeheader()
    for i in range(0, 3):
        for j in range(3, 6):
            for ratio in [0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 95, 100]:
                r = dict()
                r['testype'] = 'selfmixed'
                r['name1'] = ((('mixeddata_' + str(i)) + '_') + str(ratio))
                r['name2'] = ((('mixeddata_' + str(j)) + '_') + str(ratio))
                (r['spearman'], r['loss'], r['spear1on2'], r['spear2on1'], r['loss1on2'], r['loss2on1'], r['acc1'], r['acc2'], r['alienacc1'], r['alienacc2'], r['meandate1'], r['meandate2']) = get_divergence(r['name1'], r['name2'], twodatafolder=(('../measuredivergence/mix/' + str(ratio)) + '/'), onedatafolder=(('../measuredivergence/altmix/' + str(ratio)) + '/'))
                r['ratio'] = ratio
                write_a_row(r, outcomparisons, columns)
def new_self_comparisons():
    outcomparisons = '../measuredivergence/results/self_comparisons.tsv'
    columns = ['testype', 'name1', 'name2', 'ratio', 'spearman', 'spear1on2', 'spear2on1', 'loss', 'loss1on2', 'loss2on1', 'acc1', 'acc2', 'alienacc1', 'alienacc2', 'meandate1', 'meandate2']
    if (not os.path.isfile(outcomparisons)):
        with open(outcomparisons, mode='a', encoding='utf-8') as f:
            scribe = csv.DictWriter(f, delimiter='\t', fieldnames=columns)
            scribe.writeheader()
    for i in range(0, 3):
        for j in range(3, 6):
            for ratio in [0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 95, 100]:
                r = dict()
                r['testype'] = 'selfmixed'
                r['name1'] = ((('mixeddata_' + str(i)) + '_') + str(ratio))
                r['name2'] = ((('mixeddata_' + str(j)) + '_') + str(ratio))
                (r['spearman'], r['loss'], r['spear1on2'], r['spear2on1'], r['loss1on2'], r['loss2on1'], r['acc1'], r['acc2'], r['alienacc1'], r['alienacc2'], r['meandate1'], r['meandate2']) = get_divergence(r['name1'], r['name2'], twodatafolder=(('../measuredivergence/mix/' + str(ratio)) + '/'), onedatafolder=(('../measuredivergence/altmix/' + str(ratio)) + '/'))
                r['ratio'] = ratio
                write_a_row(r, outcomparisons, columns)