@Test public void tesAbalone() { System.out.println("Abalone"); LinearModel model = ElasticNet.fit(Abalone.formula, Abalone.train, 0.8, 0.2); System.out.println(model); double[] prediction = Validation.test(model, Abalone.test); double rmse = RMSE.of(Abalone.testy, prediction); System.out.println("Test RMSE = " + rmse); assertEquals(2.126312441862997, rmse, 1E-4); }
public static LinearModel fit(Formula formula, DataFrame data, Properties prop) { double lambda1 = Double.valueOf(prop.getProperty("smile.elastic.net.lambda1")); double lambda2 = Double.valueOf(prop.getProperty("smile.elastic.net.lambda2")); double tol = Double.valueOf(prop.getProperty("smile.elastic.net.tolerance", "1E-4")); int maxIter = Integer.valueOf(prop.getProperty("smile.elastic.net.max.iterations", "1000")); return fit(formula, data, lambda1, lambda2, tol, maxIter); }
ElasticNet { public static LinearModel fit(Formula formula, DataFrame data, Properties prop) { double lambda1 = Double.valueOf(prop.getProperty("smile.elastic.net.lambda1")); double lambda2 = Double.valueOf(prop.getProperty("smile.elastic.net.lambda2")); double tol = Double.valueOf(prop.getProperty("smile.elastic.net.tolerance", "1E-4")); int maxIter = Integer.valueOf(prop.getProperty("smile.elastic.net.max.iterations", "1000")); return fit(formula, data, lambda1, lambda2, tol, maxIter); } }
ElasticNet { public static LinearModel fit(Formula formula, DataFrame data, Properties prop) { double lambda1 = Double.valueOf(prop.getProperty("smile.elastic.net.lambda1")); double lambda2 = Double.valueOf(prop.getProperty("smile.elastic.net.lambda2")); double tol = Double.valueOf(prop.getProperty("smile.elastic.net.tolerance", "1E-4")); int maxIter = Integer.valueOf(prop.getProperty("smile.elastic.net.max.iterations", "1000")); return fit(formula, data, lambda1, lambda2, tol, maxIter); }  }
ElasticNet { public static LinearModel fit(Formula formula, DataFrame data, Properties prop) { double lambda1 = Double.valueOf(prop.getProperty("smile.elastic.net.lambda1")); double lambda2 = Double.valueOf(prop.getProperty("smile.elastic.net.lambda2")); double tol = Double.valueOf(prop.getProperty("smile.elastic.net.tolerance", "1E-4")); int maxIter = Integer.valueOf(prop.getProperty("smile.elastic.net.max.iterations", "1000")); return fit(formula, data, lambda1, lambda2, tol, maxIter); }  static LinearModel fit(Formula formula, DataFrame data, Properties prop); static LinearModel fit(Formula formula, DataFrame data, double lambda1, double lambda2); static LinearModel fit(Formula formula, DataFrame data, double lambda1, double lambda2, double tol, int maxIter); }
ElasticNet { public static LinearModel fit(Formula formula, DataFrame data, Properties prop) { double lambda1 = Double.valueOf(prop.getProperty("smile.elastic.net.lambda1")); double lambda2 = Double.valueOf(prop.getProperty("smile.elastic.net.lambda2")); double tol = Double.valueOf(prop.getProperty("smile.elastic.net.tolerance", "1E-4")); int maxIter = Integer.valueOf(prop.getProperty("smile.elastic.net.max.iterations", "1000")); return fit(formula, data, lambda1, lambda2, tol, maxIter); }  static LinearModel fit(Formula formula, DataFrame data, Properties prop); static LinearModel fit(Formula formula, DataFrame data, double lambda1, double lambda2); static LinearModel fit(Formula formula, DataFrame data, double lambda1, double lambda2, double tol, int maxIter);  }