Skip to content

Instantly share code, notes, and snippets.

@jensdebruijn
jensdebruijn / corrected_dependent_ttest.py
Last active Jul 25, 2019
Python implementation of the Nadeau and Bengio correction of dependent Student's t-test
View corrected_dependent_ttest.py
# Python implementation of the Nadeau and Bengio correction of dependent Student's t-test
# using the equation stated in https://www.cs.waikato.ac.nz/~eibe/pubs/bouckaert_and_frank.pdf
from scipy.stats import t
from math import sqrt
from statistics import stdev
def corrected_dependent_ttest(data1, data2, n_training_folds, n_test_folds, alpha):
n = len(data1)
differences = [(data1[i]-data2[i]) for i in range(n)]