3-ftransform-forecasting #5

Open
romanov73 wants to merge 27 commits from 3-f-transform into master
3 changed files with 66 additions and 0 deletions
Showing only changes of commit 63791ecfa0 - Show all commits

View File

@ -0,0 +1,17 @@
package ru.ulstu.target;
import org.springframework.stereotype.Service;
import ru.ulstu.datamodel.ts.TimeSeries;
@Service
public class AnomalyDecompose extends Target {
public AnomalyDecompose() {
super("Разложение");
}
@Override
public TimeSeries calculate(TimeSeries model) {
return null;
}
}

View File

@ -0,0 +1,35 @@
package ru.ulstu.target;
import org.springframework.stereotype.Service;
import ru.ulstu.datamodel.ModelingResult;
import ru.ulstu.datamodel.exception.ModelingException;
import ru.ulstu.datamodel.ts.TimeSeries;
import ru.ulstu.datamodel.ts.TimeSeriesValue;
import ru.ulstu.service.TimeSeriesService;
import java.lang.reflect.InvocationTargetException;
import java.util.concurrent.ExecutionException;
@Service
public class AnomalyDifferenceSmoothed extends Target {
private final TimeSeriesService timeSeriesService;
public AnomalyDifferenceSmoothed(TimeSeriesService timeSeriesService) {
super("Модель сравнения со сглаженным ВР");
this.timeSeriesService = timeSeriesService;
}
@Override
public TimeSeries calculate(TimeSeries ts) throws ModelingException, ExecutionException, InterruptedException, InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException {
TimeSeries anomalyPoints = new TimeSeries();
TimeSeries residual = new TimeSeries();
ModelingResult modelingResult = timeSeriesService.smoothTimeSeries(ts, "AddTrendAddSeason");
var tsResult = modelingResult.getTimeSeries();
for (int i = 0; i < ts.getLength(); i++) {
residual.addValue(new TimeSeriesValue(ts.getValue(i).getDate(), Math.abs(ts.getNumericValue(i) - tsResult.getNumericValue(i))));
}
return null;
}
}

View File

@ -0,0 +1,14 @@
package ru.ulstu.target;
import ru.ulstu.datamodel.ts.TimeSeries;
public class AnomalyPredictive extends Target {
public AnomalyPredictive() {
super("Прогнозная модель, %");
}
@Override
public TimeSeries calculate(TimeSeries model) {
return null;
}
}