This commit is contained in:
Anton Romanov 2021-06-25 14:57:09 +04:00
parent 791aec855e
commit 24d974fa70
3 changed files with 3 additions and 8 deletions

View File

@ -7,8 +7,7 @@
package ru.ulstu.method; package ru.ulstu.method;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import org.slf4j.Logger; import com.fasterxml.jackson.annotation.JsonProperty;
import org.slf4j.LoggerFactory;
import ru.ulstu.TimeSeriesUtils; import ru.ulstu.TimeSeriesUtils;
import ru.ulstu.datamodel.Model; import ru.ulstu.datamodel.Model;
import ru.ulstu.datamodel.exception.ForecastValidateException; import ru.ulstu.datamodel.exception.ForecastValidateException;
@ -24,8 +23,6 @@ import java.util.List;
* Наиболее общая логика моделировании и прогнозирования временных рядов * Наиболее общая логика моделировании и прогнозирования временных рядов
*/ */
public abstract class Method { public abstract class Method {
private static final Logger LOGGER = LoggerFactory.getLogger(Method.class);
@JsonIgnore @JsonIgnore
public abstract List<MethodParameter> getAvailableParameters(); public abstract List<MethodParameter> getAvailableParameters();
@ -135,6 +132,7 @@ public abstract class Method {
} }
@Override @Override
@JsonProperty("name")
public String toString() { public String toString() {
return getClass().getSimpleName(); return getClass().getSimpleName();
} }

View File

@ -32,7 +32,7 @@ public class Smape extends ScoreMethod {
sum += abs(modelValue.getValue() - actualValue) sum += abs(modelValue.getValue() - actualValue)
/ ((abs(actualValue) + abs(modelValue.getValue())) / 2); / ((abs(actualValue) + abs(modelValue.getValue())) / 2);
} }
sum = Math.round(sum * 100) / 100; sum = (double) Math.round(sum * 100) / 100;
return sum * 100 / model.getLength(); return sum * 100 / model.getLength();
} }
} }

View File

@ -6,8 +6,6 @@
package ru.ulstu.service; package ru.ulstu.service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import ru.ulstu.datamodel.ModelingResult; import ru.ulstu.datamodel.ModelingResult;
import ru.ulstu.datamodel.exception.ModelingException; import ru.ulstu.datamodel.exception.ModelingException;
@ -19,7 +17,6 @@ import java.util.concurrent.ExecutionException;
@Service @Service
public class TimeSeriesService { public class TimeSeriesService {
private static final Logger LOGGER = LoggerFactory.getLogger(TimeSeriesService.class);
private final MethodParamBruteForce methodParamBruteForce; private final MethodParamBruteForce methodParamBruteForce;
public TimeSeriesService(MethodParamBruteForce methodParamBruteForce) { public TimeSeriesService(MethodParamBruteForce methodParamBruteForce) {