def get_divergences(gold, testname, itera, size, pct):
    '\n    This function gets several possible measures of divergence\n    between two models.\n    '
    model1 = (('../measuredivergence/modeloutput/' + gold) + '.pkl')
    meta1 = (('../measuredivergence/modeloutput/' + gold) + '.csv')
    testpath = ('../measuredivergence/modeloutput/' + testname)
    model2 = (testpath + '.pkl')
    meta2 = (testpath + '.csv')
    model1on2 = versatiletrainer2.apply_pickled_model(model1, '../data/', '.tsv', meta2)
    model2on1 = versatiletrainer2.apply_pickled_model(model2, '../data/', '.tsv', meta1)
    pearson1on2 = stats.pearsonr(model1on2.probability, model1on2.alien_model)[0]
    pearson2on1 = stats.pearsonr(model2on1.probability, model2on1.alien_model)[0]
    pearson = averagecorr(pearson1on2, pearson2on1)
    spearman1on2 = stats.spearmanr(model1on2.probability, model1on2.alien_model)[0]
    spearman2on1 = stats.spearmanr(model2on1.probability, model2on1.alien_model)[0]
    spearman = averagecorr(spearman1on2, spearman2on1)
    loss1on2 = accuracy_loss(model1on2)
    loss2on1 = accuracy_loss(model2on1)
    loss = ((loss1on2 + loss2on1) / 2)
    kl1on2 = kldivergence(model1on2.probability, model1on2.alien_model)
    kl2on1 = kldivergence(model2on1.probability, model2on1.alien_model)
    kl = ((kl1on2 + kl2on1) / 2)
    return (pearson, spearman, loss, kl, spearman1on2, spearman2on1, loss1on2, loss2on1)
This function gets several possible measures of divergence
between two models.
def get_divergences(gold, testname, itera, size, pct):
    '\n    This function gets several possible measures of divergence\n    between two models.\n    '
    model1 = (('../measuredivergence/modeloutput/' + gold) + '.pkl')
    meta1 = (('../measuredivergence/modeloutput/' + gold) + '.csv')
    testpath = ('../measuredivergence/modeloutput/' + testname)
    model2 = (testpath + '.pkl')
    meta2 = (testpath + '.csv')
    model1on2 = versatiletrainer2.apply_pickled_model(model1, '../data/', '.tsv', meta2)
    model2on1 = versatiletrainer2.apply_pickled_model(model2, '../data/', '.tsv', meta1)
    pearson1on2 = stats.pearsonr(model1on2.probability, model1on2.alien_model)[0]
    pearson2on1 = stats.pearsonr(model2on1.probability, model2on1.alien_model)[0]
    pearson = averagecorr(pearson1on2, pearson2on1)
    spearman1on2 = stats.spearmanr(model1on2.probability, model1on2.alien_model)[0]
    spearman2on1 = stats.spearmanr(model2on1.probability, model2on1.alien_model)[0]
    spearman = averagecorr(spearman1on2, spearman2on1)
    loss1on2 = accuracy_loss(model1on2)
    loss2on1 = accuracy_loss(model2on1)
    loss = ((loss1on2 + loss2on1) / 2)
    kl1on2 = kldivergence(model1on2.probability, model1on2.alien_model)
    kl2on1 = kldivergence(model2on1.probability, model2on1.alien_model)
    kl = ((kl1on2 + kl2on1) / 2)
    return (pearson, spearman, loss, kl, spearman1on2, spearman2on1, loss1on2, loss2on1)