public static LinearModel fit(Formula formula, DataFrame data, Properties params) {
        double lambda1 = Double.parseDouble(params.getProperty("smile.elastic_net.lambda1"));
        double lambda2 = Double.parseDouble(params.getProperty("smile.elastic_net.lambda2"));
        double tol = Double.parseDouble(params.getProperty("smile.elastic_net.tolerance", "1E-4"));
        int maxIter = Integer.parseInt(params.getProperty("smile.elastic_net.iterations", "1000"));
        return fit(formula, data, lambda1, lambda2, tol, maxIter);
    }
@Test
    public void testLongley() throws Exception {
        System.out.println("longley");

        LinearModel model = ElasticNet.fit(Longley.formula, Longley.data, 0.1, 0.1);
        System.out.println(model);

        RegressionMetrics metrics = LOOCV.regression(Longley.formula, Longley.data,
                (f, x) -> ElasticNet.fit(f, x, 0.1, 0.1));

        System.out.println(metrics);
        assertEquals(1.7385, metrics.rmse, 1E-4);

        java.nio.file.Path temp = Write.object(model);
        Read.object(temp);
    }