public static <T> SVM<T> fit(T[] x, MercerKernel<T> kernel) {
        return fit(x, kernel, 0.5, 1E-3);
    }
@Test
    public void testSinCos() throws Exception {
        System.out.println("SinCos");

        CSVFormat format = CSVFormat.Builder.create().setDelimiter('\t').build();
        double[][] data = Read.csv(Paths.getTestData("clustering/sincos.txt"), format).toArray();
        SVM<double[]> model = SVM.fit(data, new GaussianKernel(0.5));

        double[] x = new double[51];
        double[] y = new double[51];
        for (int i = 0; i < x.length; i++) {
            x[i] = -2 + i * 0.1;
            y[i] = -2 + i * 0.1;
        }

        double[][] grid = new double[51][51];
        for (int i = 0; i < grid.length; i++) {
            for (int j = 0; j < grid[i].length; j++) {
                double[] point = {-2 + i * 0.1, -2 + j * 0.1};
                grid[j][i] = model.score(point);
            }
        }

        // ScatterPlot.of(data).canvas().window();
        // Heatmap.of(x, y, grid).canvas().window();
    }