public static <T> KNN<T> fit(T[] x, int[] y, Distance<T> distance) {
        return fit(x, y, 1, distance);
    }
@Test
    public void testPenDigits() {
        System.out.println("Pen Digits");

        MathEx.setSeed(19650218); // to get repeatable results.
        ClassificationValidations<KNN<double[]>> result = CrossValidation.classification(10, PenDigits.x, PenDigits.y,
                (x, y) -> KNN.fit(x, y, 3));

        System.out.println(result);
        assertEquals(0.9947, result.avg.accuracy, 1E-4);
    }