@Test(expected = Test.None.class) public void testColon() throws IOException { System.out.println("Colon"); BufferedReader reader = Paths.getTestDataReader("microarray/colon.txt"); int[] y = Arrays.stream(reader.readLine().split(" ")).mapToInt(s -> Integer.valueOf(s) > 0 ? 1 : 0).toArray(); double[][] x = new double[62][2000]; for (int i = 0; i < 2000; i++) { String[] tokens = reader.readLine().split(" "); for (int j = 0; j < 62; j++) { x[j][i] = Double.valueOf(tokens[j]); } } MathEx.setSeed(19650218); int[] prediction = CrossValidation.classification(5, x, y, (xi, yi) -> FLD.fit(xi, yi)); int error = Error.of(y, prediction); System.out.println("Error = " + error); assertEquals(9, error); }
public static FLD fit(Formula formula, DataFrame data) { return fit(formula, data, new Properties()); }
FLD implements Classifier<double[]>, Projection<double[]> { public static FLD fit(Formula formula, DataFrame data) { return fit(formula, data, new Properties()); } }
FLD implements Classifier<double[]>, Projection<double[]> { public static FLD fit(Formula formula, DataFrame data) { return fit(formula, data, new Properties()); } FLD(double[] mean, double[][] mu, Matrix scaling);  FLD(double[] mean, double[][] mu, Matrix scaling, IntSet labels); }
FLD implements Classifier<double[]>, Projection<double[]> { public static FLD fit(Formula formula, DataFrame data) { return fit(formula, data, new Properties()); } FLD(double[] mean, double[][] mu, Matrix scaling);  FLD(double[] mean, double[][] mu, Matrix scaling, IntSet labels); static FLD fit(Formula formula, DataFrame data); static FLD fit(Formula formula, DataFrame data, Properties prop); static FLD fit(double[][] x, int[] y); static FLD fit(double[][] x, int[] y, int L, double tol); @Override int predict(double[] x); @Override double[] project(double[] x); @Override double[][] project(double[][] x); Matrix getProjection(); }
FLD implements Classifier<double[]>, Projection<double[]> { public static FLD fit(Formula formula, DataFrame data) { return fit(formula, data, new Properties()); } FLD(double[] mean, double[][] mu, Matrix scaling);  FLD(double[] mean, double[][] mu, Matrix scaling, IntSet labels); static FLD fit(Formula formula, DataFrame data); static FLD fit(Formula formula, DataFrame data, Properties prop); static FLD fit(double[][] x, int[] y); static FLD fit(double[][] x, int[] y, int L, double tol); @Override int predict(double[] x); @Override double[] project(double[] x); @Override double[][] project(double[][] x); Matrix getProjection();  }