@Test public void testBreastCancer() { System.out.println("Breast Cancer"); MathEx.setSeed(19650218); int[] prediction = CrossValidation.classification(10, BreastCancer.formula, BreastCancer.data, (f, x) -> DecisionTree.fit(f, x, SplitRule.GINI, 20, 100, 5)); int error = Error.of(BreastCancer.y, prediction); System.out.println("Error = " + error); assertEquals(42, error); }
public static DecisionTree fit(Formula formula, DataFrame data) { return fit(formula, data, new Properties()); }
DecisionTree extends CART implements SoftClassifier<Tuple>, DataFrameClassifier { public static DecisionTree fit(Formula formula, DataFrame data) { return fit(formula, data, new Properties()); } }
DecisionTree extends CART implements SoftClassifier<Tuple>, DataFrameClassifier { public static DecisionTree fit(Formula formula, DataFrame data) { return fit(formula, data, new Properties()); } DecisionTree(DataFrame x, int[] y, StructField response, int k, SplitRule rule, int maxDepth, int maxNodes, int nodeSize, int mtry, int[] samples, int[][] order); private  DecisionTree(Formula formula, StructType schema, StructField response, Node root, int k, SplitRule rule, double[] importance, IntSet labels); }
DecisionTree extends CART implements SoftClassifier<Tuple>, DataFrameClassifier { public static DecisionTree fit(Formula formula, DataFrame data) { return fit(formula, data, new Properties()); } DecisionTree(DataFrame x, int[] y, StructField response, int k, SplitRule rule, int maxDepth, int maxNodes, int nodeSize, int mtry, int[] samples, int[][] order); private  DecisionTree(Formula formula, StructType schema, StructField response, Node root, int k, SplitRule rule, double[] importance, IntSet labels); static DecisionTree fit(Formula formula, DataFrame data); static DecisionTree fit(Formula formula, DataFrame data, Properties prop); static DecisionTree fit(Formula formula, DataFrame data, SplitRule rule, int maxDepth, int maxNodes, int nodeSize); @Override int predict(Tuple x); @Override int predict(Tuple x, double[] posteriori); @Override Formula formula(); @Override StructType schema(); DecisionTree prune(DataFrame test); }
DecisionTree extends CART implements SoftClassifier<Tuple>, DataFrameClassifier { public static DecisionTree fit(Formula formula, DataFrame data) { return fit(formula, data, new Properties()); } DecisionTree(DataFrame x, int[] y, StructField response, int k, SplitRule rule, int maxDepth, int maxNodes, int nodeSize, int mtry, int[] samples, int[][] order); private  DecisionTree(Formula formula, StructType schema, StructField response, Node root, int k, SplitRule rule, double[] importance, IntSet labels); static DecisionTree fit(Formula formula, DataFrame data); static DecisionTree fit(Formula formula, DataFrame data, Properties prop); static DecisionTree fit(Formula formula, DataFrame data, SplitRule rule, int maxDepth, int maxNodes, int nodeSize); @Override int predict(Tuple x); @Override int predict(Tuple x, double[] posteriori); @Override Formula formula(); @Override StructType schema(); DecisionTree prune(DataFrame test);  }