def get_divergence(sampleA, sampleB, twodatafolder='../data/', onedatafolder='../data/'):
    '\n    This function applies model a to b, and vice versa, and returns\n    a couple of measures of divergence: notably lost accuracy and\n    z-tranformed spearman correlation.\n    '
    model1 = (('../measuredivergence/newmodeloutput/' + sampleA) + '.pkl')
    meta1 = (('../measuredivergence/newmodeloutput/' + sampleA) + '.csv')
    model2 = (('../measuredivergence/newmodeloutput/' + sampleB) + '.pkl')
    meta2 = (('../measuredivergence/newmodeloutput/' + sampleB) + '.csv')
    model1on2 = versatiletrainer2.apply_pickled_model(model1, twodatafolder, '.tsv', meta2)
    model2on1 = versatiletrainer2.apply_pickled_model(model2, onedatafolder, '.tsv', meta1)
    spearman1on2 = np.arctanh(stats.spearmanr(model1on2.probability, model1on2.alien_model)[0])
    spearman2on1 = np.arctanh(stats.spearmanr(model2on1.probability, model2on1.alien_model)[0])
    spearman = ((spearman1on2 + spearman2on1) / 2)
    loss1on2 = accuracy_loss(model1on2)
    loss2on1 = accuracy_loss(model2on1)
    loss = ((loss1on2 + loss2on1) / 2)
    alienacc2 = accuracy(model1on2, 'alien_model')
    alienacc1 = accuracy(model2on1, 'alien_model')
    acc2 = accuracy(model1on2, 'probability')
    acc1 = accuracy(model2on1, 'probability')
    meandate2 = np.mean(model1on2.std_date)
    meandate1 = np.mean(model2on1.std_date)
    return (spearman, loss, spearman1on2, spearman2on1, loss1on2, loss2on1, acc1, acc2, alienacc1, alienacc2, meandate1, meandate2)
This function applies model a to b, and vice versa, and returns
a couple of measures of divergence: notably lost accuracy and
z-tranformed spearman correlation.
def get_divergence(sampleA, sampleB, twodatafolder='../data/', onedatafolder='../data/'):
    '\n    This function applies model a to b, and vice versa, and returns\n    a couple of measures of divergence: notably lost accuracy and\n    z-tranformed spearman correlation.\n    '
    model1 = (('../measuredivergence/newmodeloutput/' + sampleA) + '.pkl')
    meta1 = (('../measuredivergence/newmodeloutput/' + sampleA) + '.csv')
    model2 = (('../measuredivergence/newmodeloutput/' + sampleB) + '.pkl')
    meta2 = (('../measuredivergence/newmodeloutput/' + sampleB) + '.csv')
    model1on2 = versatiletrainer2.apply_pickled_model(model1, twodatafolder, '.tsv', meta2)
    model2on1 = versatiletrainer2.apply_pickled_model(model2, onedatafolder, '.tsv', meta1)
    spearman1on2 = np.arctanh(stats.spearmanr(model1on2.probability, model1on2.alien_model)[0])
    spearman2on1 = np.arctanh(stats.spearmanr(model2on1.probability, model2on1.alien_model)[0])
    spearman = ((spearman1on2 + spearman2on1) / 2)
    loss1on2 = accuracy_loss(model1on2)
    loss2on1 = accuracy_loss(model2on1)
    loss = ((loss1on2 + loss2on1) / 2)
    alienacc2 = accuracy(model1on2, 'alien_model')
    alienacc1 = accuracy(model2on1, 'alien_model')
    acc2 = accuracy(model1on2, 'probability')
    acc1 = accuracy(model2on1, 'probability')
    meandate2 = np.mean(model1on2.std_date)
    meandate1 = np.mean(model2on1.std_date)
    return (spearman, loss, spearman1on2, spearman2on1, loss1on2, loss2on1, acc1, acc2, alienacc1, alienacc2, meandate1, meandate2)