I reviewed the TwoSample class.
I fail to understand why you would loop thru all the iterations of sliding windows of the vector X in your process_batch function:
When printing where you collect the test-statistics you seem to compare sliding windows of N=1 ?!.
That does not make sense, even though the changepoint detection seems to work, besides it is very slow run time due to the permutations.
Can you mabye comment on this, what is the statistical reasoning behind it? I was looking into refactoring this to make it faster an leaner.
while self.t < len(X):
Dkn = []
for k in range(1, self.t):
x, y = X[tau:k], X[k:self.t]
# Different syntax for each Scipy test
print(f"X[{tau}:{k}] vs X[{k}:{self.t}]")
X[0:1] vs X[1:2]
X[0:1] vs X[1:3]
X[0:2] vs X[2:3]
X[0:1] vs X[1:4]
X[0:2] vs X[2:4]
X[0:3] vs X[3:4]
X[0:1] vs X[1:5]
X[0:2] vs X[2:5]
X[0:3] vs X[3:5]
X[0:4] vs X[4:5]
X[0:1] vs X[1:6]
X[0:2] vs X[2:6]
X[0:3] vs X[3:6]
X[0:4] vs X[4:6]