Esempio n. 1
0
  @Test
  public void testGetResultFeatureCount_noPostProcessor() {
    final VariableContext variableContext = createVariableContext();
    final BinManager binManager =
        new BinManager(variableContext, new AggregatorAverageML(variableContext, "e", null));

    final int featureCount = binManager.getResultFeatureCount();
    assertEquals(4, featureCount);
  }
Esempio n. 2
0
  @Test
  public void testGetResultFeatureCount_withPostProcessor() {
    final VariableContext variableContext = createVariableContext();
    final FeatureSelection.Config ppSelection = new FeatureSelection.Config("f_max");

    final BinManager binManager =
        new BinManager(variableContext, ppSelection, new AggregatorMinMax(variableContext, "f"));

    final int featureCount = binManager.getResultFeatureCount();
    assertEquals(1, featureCount);
  }
Esempio n. 3
0
  @Test
  public void testGetResultFeatureNames_noPostProcessor() {
    final VariableContext variableContext = createVariableContext();
    final BinManager binManager =
        new BinManager(variableContext, new AggregatorAverage(variableContext, "d", null));

    final String[] resultFeatureNames = binManager.getResultFeatureNames();
    assertEquals(2, resultFeatureNames.length);
    assertEquals("d_mean", resultFeatureNames[0]);
    assertEquals("d_sigma", resultFeatureNames[1]);
  }
Esempio n. 4
0
  @Test
  public void testGetResultFeatureNames_withPostProcessor() {
    final VariableContext variableContext = createVariableContext();
    final FeatureSelection.Config ppSelection = new FeatureSelection.Config("e_min");

    final BinManager binManager =
        new BinManager(variableContext, ppSelection, new AggregatorMinMax(variableContext, "e"));

    final String[] resultFeatureNames = binManager.getResultFeatureNames();
    assertEquals(1, resultFeatureNames.length);
    assertEquals("e_min", resultFeatureNames[0]);
  }
Esempio n. 5
0
  @Test
  public void testBinCreation() {
    VariableContext variableContext = createVariableContext();
    BinManager binManager =
        new BinManager(
            variableContext,
            new AggregatorAverage(variableContext, "c", null),
            new AggregatorAverageML(variableContext, "b", null),
            new AggregatorMinMax(variableContext, "a"),
            new AggregatorOnMaxSet(variableContext, "c", "a", "b"));

    assertEquals(4, binManager.getAggregatorCount());

    SpatialBin sbin = binManager.createSpatialBin(42);
    assertEquals(42, sbin.getIndex());
    assertEquals(2 + 2 + 2 + 4, sbin.getFeatureValues().length);

    TemporalBin tbin = binManager.createTemporalBin(42);
    assertEquals(42, tbin.getIndex());
    assertEquals(3 + 3 + 2 + 4, tbin.getFeatureValues().length);
  }