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

        ClassificationMetrics metrics = LOOCV.classification(WeatherNominal.onehot, WeatherNominal.y, (x, y) -> KNN.fit(x, y));
        System.out.println("1-NN Error: " + metrics);
        assertEquals(8, metrics.error);

        metrics = LOOCV.classification(WeatherNominal.onehot, WeatherNominal.y, (x, y) -> KNN.fit(x, y, 3));
        System.out.println("3-NN Error: " + metrics);
        assertEquals(7, metrics.error);

        metrics = LOOCV.classification(WeatherNominal.onehot, WeatherNominal.y, (x, y) -> KNN.fit(x, y, 5));
        System.out.println("5-NN Error: " + metrics);
        assertEquals(8, metrics.error);

        metrics = LOOCV.classification(WeatherNominal.onehot, WeatherNominal.y, (x, y) -> KNN.fit(x, y,7));
        System.out.println("7-NN Error: " + metrics);
        assertEquals(5, metrics.error);
    }