show best method in json

This commit is contained in:
Anton Romanov 2021-06-25 09:45:52 +04:00
parent 0196a478da
commit 791aec855e
2 changed files with 6 additions and 1 deletions

View File

@ -133,4 +133,9 @@ public abstract class Method {
protected void validateAdditionalParams(TimeSeries timeSeries, List<MethodParamValue> parameters) throws ModelingException {
}
@Override
public String toString() {
return getClass().getSimpleName();
}
}

View File

@ -73,7 +73,7 @@ public class MethodParamBruteForce {
}
ModelingResult bestResult = results2.stream()
.min(Comparator.comparing(modelingResult -> modelingResult.getScore().getDoubleValue()))
.orElse(null);
.orElseThrow(() -> new ModelingException("Лучший метод не найден"));
TimeSeries forecast = bestResult.getTimeSeriesMethod().getForecast(timeSeries,
bestResult.getParamValues(),