The authors propose a spectral regularized kernel two-sample test that is minimax optimal, outperforming the popular maximum mean discrepancy (MMD) test.