fix forecast

This commit is contained in:
Anton Romanov 2021-06-23 15:40:57 +04:00
parent 0021899382
commit f7666b085e

View File

@ -68,9 +68,13 @@ public class MethodParamBruteForce {
ModelingResult bestResult = results2.stream() ModelingResult bestResult = results2.stream()
.min(Comparator.comparing(modelingResult -> modelingResult.getScore().getDoubleValue())) .min(Comparator.comparing(modelingResult -> modelingResult.getScore().getDoubleValue()))
.orElse(null); .orElse(null);
return new ModelingResult(bestResult.getTimeSeriesMethod().getForecast(timeSeries,
TimeSeries forecast = bestResult.getTimeSeriesMethod().getForecast(timeSeries,
bestResult.getParamValues(), bestResult.getParamValues(),
countPoints), countPoints);
forecast.getValue(0).setValue(timeSeries.getNumericValue(timeSeries.getLength() - 1));
return new ModelingResult(forecast,
bestResult.getParamValues(), bestResult.getParamValues(),
bestResult.getScore(), bestResult.getScore(),
bestResult.getTimeSeriesMethod()); bestResult.getTimeSeriesMethod());