Skip to content

Instantly share code, notes, and snippets.

@jensdebruijn
jensdebruijn / corrected_dependent_ttest.py
Last active December 21, 2023 14:49
Python implementation of the Nadeau and Bengio correction of dependent Student's t-test
# 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_samples, n_test_samples, alpha):
n = len(data1)
differences = [(data1[i]-data2[i]) for i in range(n)]