@Test public void testComputeSplit() throws DescriptorException { Data[] datas = generateTrainingData(); RegressionSplit igSplit = new RegressionSplit(); Split split = igSplit.computeSplit(datas[0], 1); assertEquals(180.0, split.getIg(), EPSILON); assertEquals(38.0, split.getSplit(), EPSILON); split = igSplit.computeSplit(datas[0].subset(Condition.lesser(1, 38.0)), 1); assertEquals(76.5, split.getIg(), EPSILON); assertEquals(21.5, split.getSplit(), EPSILON); split = igSplit.computeSplit(datas[1], 0); assertEquals(2205.0, split.getIg(), EPSILON); assertEquals(Double.NaN, split.getSplit(), EPSILON); split = igSplit.computeSplit(datas[1].subset(Condition.equals(0, 0.0)), 1); assertEquals(250.0, split.getIg(), EPSILON); assertEquals(41.0, split.getSplit(), EPSILON); }
@Override public Split computeSplit(Data data, int attr) { if (data.getDataset().isNumerical(attr)) { return numericalSplit(data, attr); } else { return categoricalSplit(data, attr); } }
RegressionSplit extends IgSplit { @Override public Split computeSplit(Data data, int attr) { if (data.getDataset().isNumerical(attr)) { return numericalSplit(data, attr); } else { return categoricalSplit(data, attr); } } }
RegressionSplit extends IgSplit { @Override public Split computeSplit(Data data, int attr) { if (data.getDataset().isNumerical(attr)) { return numericalSplit(data, attr); } else { return categoricalSplit(data, attr); } }  }
RegressionSplit extends IgSplit { @Override public Split computeSplit(Data data, int attr) { if (data.getDataset().isNumerical(attr)) { return numericalSplit(data, attr); } else { return categoricalSplit(data, attr); } }  @Override Split computeSplit(Data data, int attr); }
RegressionSplit extends IgSplit { @Override public Split computeSplit(Data data, int attr) { if (data.getDataset().isNumerical(attr)) { return numericalSplit(data, attr); } else { return categoricalSplit(data, attr); } }  @Override Split computeSplit(Data data, int attr);  }