@Test public void testBreastCancer() { System.out.println("Breast Cancer"); MathEx.setSeed(19650218); int[] prediction = CrossValidation.classification(10, BreastCancer.formula, BreastCancer.data, (f, x) -> RandomForest.fit(f, x, 100, 5, SplitRule.GINI, 20, 100, 5, 1.0, null, Arrays.stream(seeds))); int error = Error.of(BreastCancer.y, prediction); System.out.println("Error = " + error); assertEquals(27, error); }
public static RandomForest fit(Formula formula, DataFrame data) { return fit(formula, data, new Properties()); }
RandomForest implements SoftClassifier<Tuple>, DataFrameClassifier, TreeSHAP { public static RandomForest fit(Formula formula, DataFrame data) { return fit(formula, data, new Properties()); } }
RandomForest implements SoftClassifier<Tuple>, DataFrameClassifier, TreeSHAP { public static RandomForest fit(Formula formula, DataFrame data) { return fit(formula, data, new Properties()); } RandomForest(Formula formula, int k, List<Tree> trees, double error, double[] importance);  RandomForest(Formula formula, int k, List<Tree> trees, double error, double[] importance, IntSet labels); }
RandomForest implements SoftClassifier<Tuple>, DataFrameClassifier, TreeSHAP { public static RandomForest fit(Formula formula, DataFrame data) { return fit(formula, data, new Properties()); } RandomForest(Formula formula, int k, List<Tree> trees, double error, double[] importance);  RandomForest(Formula formula, int k, List<Tree> trees, double error, double[] importance, IntSet labels); static RandomForest fit(Formula formula, DataFrame data); static RandomForest fit(Formula formula, DataFrame data, Properties prop); static RandomForest fit(Formula formula, DataFrame data, int ntrees, int mtry,
                                   SplitRule rule, int maxDepth, int maxNodes, int nodeSize, double subsample); static RandomForest fit(Formula formula, DataFrame data, int ntrees, int mtry,
                                   SplitRule rule, int maxDepth, int maxNodes, int nodeSize,
                                   double subsample, int[] classWeight); static RandomForest fit(Formula formula, DataFrame data, int ntrees, int mtry,
                                   SplitRule rule, int maxDepth, int maxNodes, int nodeSize,
                                   double subsample, int[] classWeight, LongStream seeds); @Override Formula formula(); @Override StructType schema(); double error(); double[] importance(); int size(); DecisionTree[] trees(); void trim(int ntrees); @Override int predict(Tuple x); @Override int predict(Tuple x, double[] posteriori); int vote(Tuple x, double[] posteriori); int[][] test(DataFrame data); RandomForest prune(DataFrame test); }
RandomForest implements SoftClassifier<Tuple>, DataFrameClassifier, TreeSHAP { public static RandomForest fit(Formula formula, DataFrame data) { return fit(formula, data, new Properties()); } RandomForest(Formula formula, int k, List<Tree> trees, double error, double[] importance);  RandomForest(Formula formula, int k, List<Tree> trees, double error, double[] importance, IntSet labels); static RandomForest fit(Formula formula, DataFrame data); static RandomForest fit(Formula formula, DataFrame data, Properties prop); static RandomForest fit(Formula formula, DataFrame data, int ntrees, int mtry,
                                   SplitRule rule, int maxDepth, int maxNodes, int nodeSize, double subsample); static RandomForest fit(Formula formula, DataFrame data, int ntrees, int mtry,
                                   SplitRule rule, int maxDepth, int maxNodes, int nodeSize,
                                   double subsample, int[] classWeight); static RandomForest fit(Formula formula, DataFrame data, int ntrees, int mtry,
                                   SplitRule rule, int maxDepth, int maxNodes, int nodeSize,
                                   double subsample, int[] classWeight, LongStream seeds); @Override Formula formula(); @Override StructType schema(); double error(); double[] importance(); int size(); DecisionTree[] trees(); void trim(int ntrees); @Override int predict(Tuple x); @Override int predict(Tuple x, double[] posteriori); int vote(Tuple x, double[] posteriori); int[][] test(DataFrame data); RandomForest prune(DataFrame test);  }