SFA implements IFilter { @Override public TimeSeriesDataset2 fitTransform(final TimeSeriesDataset2 input) { this.fit(input); return this.transform(input); } SFA(final double[] alphabet, final int wordLength); void setNumberOfDesieredDFTCoefficients(final int numberOfDesieredDFTCoefficients); void disableRekursiv(); void enableRekursiv(); @Override TimeSeriesDataset2 transform(final TimeSeriesDataset2 input); @Override void fit(final TimeSeriesDataset2 input); @Override TimeSeriesDataset2 fitTransform(final TimeSeriesDataset2 input); @Override double[] transform(final double[] input); @Override void fit(final double[] input); @Override double[] fitTransform(final double[] input); @Override double[][] transform(final double[][] input); @Override void fit(final double[][] input); @Override double[][] fitTransform(final double[][] input);  }
@Test public void test() { SFA testSFA = new SFA(new double[] { 1, 2, 3 }, 4); SlidingWindowBuilder builder = new SlidingWindowBuilder(); builder.setDefaultWindowSize(3); for (double[][] matrix : this.dataset.getValueMatrices()) { for (double[] instance : matrix) { TimeSeriesDataset2 tmp = testSFA.fitTransform((builder.specialFitTransform(instance))); for (double[][] m : tmp.getValueMatrices()) { for (double[] i : m) { fail("This fail is just here to announce that this test does not really test anything at all. Insert a meaningful check. Output to prevent SQ to fire: " + i); } } } } TimeSeriesDataset2 output = testSFA.fitTransform(this.dataset); assertEquals(2, output.getValues(0)[0][0], 1.0E-5); }