I am doing ANN data output denormalization in this way:
double[] forecast = new double[LEAD_LENGTH + 2]; network.compute(normalizer.process(Arrays.copyOfRange(dst, dst.length - LAG_LENGTH, dst.length)), forecast); forecast[forecast.length - 2] = -Double.MAX_VALUE; forecast[forecast.length - 1] = +Double.MAX_VALUE; ACTIVATION.activationFunction(forecast, forecast.length - 2, 2); normalizer.setNormalizedLow(Arrays.stream(dst).min().getAsDouble()); normalizer.setNormalizedHigh(Arrays.stream(dst).max().getAsDouble()); forecast = Arrays.copyOfRange(normalizer.process(forecast), 0, forecast.length - 2); System.out.println("Forecast:\t" + Arrays.toString(forecast));
It is not very elegant to be done by this way. I am wondering is there any better way in which denormalization can be done in Encog Machine Learning Framework?