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

        ClassificationMetrics metrics = LOOCV.classification(Iris.x, Iris.y, (x, y) -> KNN.fit(x, y,1));
        System.out.println("1-NN Error: " + metrics);
        assertEquals(0.96, metrics.accuracy, 1E-4);

        metrics = LOOCV.classification(Iris.x, Iris.y, (x, y) -> KNN.fit(x, y,3));
        System.out.println("3-NN Error: " + metrics);
        assertEquals(0.96, metrics.accuracy, 1E-4);

        metrics = LOOCV.classification(Iris.x, Iris.y, (x, y) -> KNN.fit(x, y,5));
        System.out.println("5-NN Error: " + metrics);
        assertEquals(0.9667, metrics.accuracy, 1E-4);

        metrics = LOOCV.classification(Iris.x, Iris.y, (x, y) -> KNN.fit(x, y,7));
        System.out.println("7-NN Error: " + metrics);
        assertEquals(0.9667, metrics.accuracy, 1E-4);
    }