DFT extends AFilter { @Override public void fit(final TimeSeriesDataset2 input) { if (input.isEmpty()) { throw new IllegalArgumentException("This method can not work with an empty dataset."); } this.dftCoefficients.clear(); for (int matrix = 0; matrix < input.getNumberOfVariables(); matrix++) { this.fitTransform(input.getValues(matrix)); this.fittedMatrix = false; this.dftCoefficients.add(this.dftCoefficientsMatrix); } this.fitted = true; }  void setNumberOfDisieredCoefficients(final int numberOfDisieredCoefficients); void setMeanCorrected(final boolean meanCorrected); @Override TimeSeriesDataset2 transform(final TimeSeriesDataset2 input); @Override void fit(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); double[][] rekursivDFT(final double[][] input); TimeSeriesDataset2 rekursivDFT(final TimeSeriesDataset2 input);  }
@Test public void testFit() { DFT testDFT = new DFT(); testDFT.setNumberOfDisieredCoefficients(2); testDFT.fit(this.dataset); TimeSeriesDataset2 output = null; SlidingWindowBuilder slide = new SlidingWindowBuilder(); slide.setDefaultWindowSize(3); for(double[][] matrix : this.dataset.getValueMatrices()) { for(double[] instance : matrix) { TimeSeriesDataset2 tmp2= testDFT.rekursivDFT(slide.specialFitTransform(instance)); for(double[][] m : tmp2.getValueMatrices()) { for(double[] i : m) { System.out.println(Arrays.toString(i)); System.out.println("------------------------------------------------"); } System.out.println("------------------------------------------------"); } System.out.println("------------------------------------------------"); } } output = testDFT.transform(this.dataset); System.out.println("iterativ"); System.out.println("------------------------------------------------"); for(double[][] m : output.getValueMatrices()) { for(double[] i : m) { System.out.println(Arrays.toString(i)); } } System.out.println("iterativ slides"); System.out.println("------------------------------------------------"); for(double[][] matrix : this.dataset.getValueMatrices()) { for(double[] instance : matrix) { TimeSeriesDataset2 tmp2= testDFT.fitTransform((slide.specialFitTransform(instance))); System.out.println(tmp2.getNumberOfVariables()); for(double[][] m : tmp2.getValueMatrices()) { for(double[] i : m) { System.out.println(Arrays.toString(i)); System.out.println("------------------------------------------------"); } System.out.println("-----------hallo-------------------------------------"); } System.out.println("-----------DataSetFinished------------------------------------"); } } assertEquals(1,output.getValues(0)[0][0], 1.0E-5); assertEquals(0, output.getValues(0)[0][1], 1.0E-5); }