public static Regression<double[]> fit(double[][] x, double[] y, double eps, double C, double tol) {
        smile.base.svm.SVR<double[]> svr = new smile.base.svm.SVR<>(new LinearKernel(), eps, C, tol);
        KernelMachine<double[]> svm = svr.fit(x, y);

        return new Regression<>() {
            final LinearKernelMachine model = LinearKernelMachine.of(svm);

            @Override
            public double predict(double[] x) {
                return model.f(x);
            }
        };
    }
@Test
    public void testLongley() throws Exception {
        System.out.println("longley");

        RegressionMetrics metrics = LOOCV.regression(Longley.x, Longley.y, (x, y) -> SVM.fit(x, y, 2.0, 10.0, 1E-3));

        System.out.println("LOOCV RMSE = " + metrics.rmse);
        assertEquals(1.6140, metrics.rmse, 1E-4);

        Regression<double[]> model = SVM.fit(Longley.x, Longley.y, 2.0, 10.0, 1E-3);
        java.nio.file.Path temp = Write.object(model);
        Read.object(temp);
    }