mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-24 22:48:34 +00:00
Improved wind estimation evaluation framework regarding transition
probabilities calculator specification for hmm
This commit is contained in:
+7
-6
@@ -23,18 +23,18 @@ public class SimpleConfigurableManeuverBasedWindEstimationComponentImpl extends
|
||||
|
||||
private static final boolean PRELOAD_ALL_MODELS = false;
|
||||
private static final int MODEL_CACHE_KEEP_ALIVE_MILLIS = 3600000;
|
||||
private static final HmmTransitionProbabilitiesCalculator transitionProbabilitiesCalculatorType = HmmTransitionProbabilitiesCalculator.INTERSECTED;
|
||||
private static final boolean propagateIntersectedWindRangeOfHeadupAndBearAway = false;
|
||||
private static final boolean propagateIntersectedWindRangeOfHeadupAndBearAway = true;
|
||||
|
||||
public SimpleConfigurableManeuverBasedWindEstimationComponentImpl(ManeuverFeatures maneuverFeatures,
|
||||
ModelStore modelStore, PolarDataService polarService,
|
||||
RacePreprocessingPipeline<CompleteManeuverCurveWithEstimationData, ManeuverForEstimation> preprocessingPipeline,
|
||||
ManeuverClassificationsAggregatorImplementation aggregatorImplementation) {
|
||||
ManeuverClassificationsAggregatorImplementation aggregatorImplementation,
|
||||
HmmTransitionProbabilitiesCalculator transitionProbabilitiesCalculator) {
|
||||
super(preprocessingPipeline,
|
||||
new ManeuverClassifiersCache(modelStore, PRELOAD_ALL_MODELS, MODEL_CACHE_KEEP_ALIVE_MILLIS,
|
||||
maneuverFeatures),
|
||||
aggregatorImplementation.createNewInstance(polarService, modelStore, PRELOAD_ALL_MODELS,
|
||||
MODEL_CACHE_KEEP_ALIVE_MILLIS),
|
||||
MODEL_CACHE_KEEP_ALIVE_MILLIS, transitionProbabilitiesCalculator),
|
||||
new WindTrackCalculatorImpl(new MiddleCourseBasedTwdCalculatorImpl(),
|
||||
maneuverFeatures.isPolarsInformation() ? new PolarsBasedTwsCalculatorImpl(polarService)
|
||||
: new DummyBasedTwsCalculatorImpl()));
|
||||
@@ -46,7 +46,7 @@ public class SimpleConfigurableManeuverBasedWindEstimationComponentImpl extends
|
||||
this(maneuverFeatures, modelStore, polarService,
|
||||
new RaceElementsFilteringPreprocessingPipelineImpl(
|
||||
new CompleteManeuverCurveWithEstimationDataToManeuverForEstimationTransformer()),
|
||||
aggregatorImplementation);
|
||||
aggregatorImplementation, HmmTransitionProbabilitiesCalculator.GAUSSIAN_REGRESSOR);
|
||||
}
|
||||
|
||||
public SimpleConfigurableManeuverBasedWindEstimationComponentImpl(ManeuverFeatures maneuverFeatures,
|
||||
@@ -58,7 +58,8 @@ public class SimpleConfigurableManeuverBasedWindEstimationComponentImpl extends
|
||||
HMM, MST_HMM, CLUSTERING, MEAN_OUTLIER, NEIGHBOR_OUTLIER;
|
||||
|
||||
ManeuverClassificationsAggregator createNewInstance(PolarDataService polarService, ModelStore modelStore,
|
||||
boolean preloadAllModels, long modelCacheKeepAliveMillis) {
|
||||
boolean preloadAllModels, long modelCacheKeepAliveMillis,
|
||||
HmmTransitionProbabilitiesCalculator transitionProbabilitiesCalculatorType) {
|
||||
ManeuverClassificationsAggregatorFactory factory = new ManeuverClassificationsAggregatorFactory(
|
||||
polarService, modelStore, preloadAllModels, modelCacheKeepAliveMillis);
|
||||
switch (this) {
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
package com.sap.sailing.windestimation.evaluation;
|
||||
|
||||
public enum EvaluatableWindEstimationImplementation {
|
||||
HMM, MST_HMM, CLUSTERING, MEAN_OUTLIER, NEIGHBOR_OUTLIER, POLARS_FITTING
|
||||
HMM, HMM_GAUSS, MST_HMM, CLUSTERING, MEAN_OUTLIER, NEIGHBOR_OUTLIER, POLARS_FITTING
|
||||
}
|
||||
|
||||
+11
-7
@@ -6,6 +6,7 @@ import com.sap.sailing.windestimation.PolarsFittingBasedWindEstimationComponentI
|
||||
import com.sap.sailing.windestimation.SimpleConfigurableManeuverBasedWindEstimationComponentImpl;
|
||||
import com.sap.sailing.windestimation.SimpleConfigurableManeuverBasedWindEstimationComponentImpl.ManeuverClassificationsAggregatorImplementation;
|
||||
import com.sap.sailing.windestimation.WindEstimationComponent;
|
||||
import com.sap.sailing.windestimation.aggregator.ManeuverClassificationsAggregatorFactory.HmmTransitionProbabilitiesCalculator;
|
||||
import com.sap.sailing.windestimation.data.RaceWithEstimationData;
|
||||
import com.sap.sailing.windestimation.data.transformer.CompleteManeuverCurveWithEstimationDataToManeuverForEstimationTransformer;
|
||||
import com.sap.sailing.windestimation.model.classifier.maneuver.ManeuverFeatures;
|
||||
@@ -34,7 +35,9 @@ public class WindEstimatorFactories {
|
||||
EvaluatableWindEstimationImplementation windEstimationImplementation) {
|
||||
switch (windEstimationImplementation) {
|
||||
case HMM:
|
||||
return hmm();
|
||||
return hmm(HmmTransitionProbabilitiesCalculator.INTERSECTED);
|
||||
case HMM_GAUSS:
|
||||
return hmm(HmmTransitionProbabilitiesCalculator.GAUSSIAN_REGRESSOR);
|
||||
case MST_HMM:
|
||||
return mstHmm();
|
||||
case CLUSTERING:
|
||||
@@ -49,7 +52,8 @@ public class WindEstimatorFactories {
|
||||
throw new IllegalArgumentException(windEstimationImplementation + " is unsupported");
|
||||
}
|
||||
|
||||
public WindEstimatorFactory<RaceWithEstimationData<CompleteManeuverCurveWithEstimationData>> hmm() {
|
||||
public WindEstimatorFactory<RaceWithEstimationData<CompleteManeuverCurveWithEstimationData>> hmm(
|
||||
HmmTransitionProbabilitiesCalculator transitionProbabilitiesCalculator) {
|
||||
return new WindEstimatorFactory<RaceWithEstimationData<CompleteManeuverCurveWithEstimationData>>() {
|
||||
|
||||
@Override
|
||||
@@ -58,7 +62,7 @@ public class WindEstimatorFactories {
|
||||
polarService,
|
||||
new RaceElementsFilteringPreprocessingPipelineImpl(
|
||||
new CompleteManeuverCurveWithEstimationDataToManeuverForEstimationTransformer()),
|
||||
ManeuverClassificationsAggregatorImplementation.HMM);
|
||||
ManeuverClassificationsAggregatorImplementation.HMM, transitionProbabilitiesCalculator);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -77,7 +81,7 @@ public class WindEstimatorFactories {
|
||||
polarService,
|
||||
new RaceElementsFilteringPreprocessingPipelineImpl(
|
||||
new CompleteManeuverCurveWithEstimationDataToManeuverForEstimationTransformer()),
|
||||
ManeuverClassificationsAggregatorImplementation.MST_HMM);
|
||||
ManeuverClassificationsAggregatorImplementation.MST_HMM, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -96,7 +100,7 @@ public class WindEstimatorFactories {
|
||||
polarService,
|
||||
new RaceElementsFilteringPreprocessingPipelineImpl(
|
||||
new CompleteManeuverCurveWithEstimationDataToManeuverForEstimationTransformer()),
|
||||
ManeuverClassificationsAggregatorImplementation.CLUSTERING);
|
||||
ManeuverClassificationsAggregatorImplementation.CLUSTERING, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -133,7 +137,7 @@ public class WindEstimatorFactories {
|
||||
polarService,
|
||||
new RaceElementsFilteringPreprocessingPipelineImpl(
|
||||
new CompleteManeuverCurveWithEstimationDataToManeuverForEstimationTransformer()),
|
||||
ManeuverClassificationsAggregatorImplementation.MEAN_OUTLIER);
|
||||
ManeuverClassificationsAggregatorImplementation.MEAN_OUTLIER, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -152,7 +156,7 @@ public class WindEstimatorFactories {
|
||||
polarService,
|
||||
new RaceElementsFilteringPreprocessingPipelineImpl(
|
||||
new CompleteManeuverCurveWithEstimationDataToManeuverForEstimationTransformer()),
|
||||
ManeuverClassificationsAggregatorImplementation.NEIGHBOR_OUTLIER);
|
||||
ManeuverClassificationsAggregatorImplementation.NEIGHBOR_OUTLIER, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+6
-6
@@ -12,22 +12,22 @@ import com.sap.sailing.windestimation.data.persistence.maneuver.PersistedElement
|
||||
import com.sap.sailing.windestimation.data.persistence.maneuver.RaceWithCompleteManeuverCurvePersistenceManager;
|
||||
import com.sap.sailing.windestimation.data.persistence.polars.PolarDataServiceAccessUtil;
|
||||
import com.sap.sailing.windestimation.model.classifier.maneuver.ManeuverFeatures;
|
||||
import com.sap.sailing.windestimation.model.store.FileSystemModelStoreImpl;
|
||||
import com.sap.sailing.windestimation.model.store.ModelStore;
|
||||
import com.sap.sailing.windestimation.model.store.MongoDbModelStoreImpl;
|
||||
import com.sap.sailing.windestimation.util.LoggingUtil;
|
||||
|
||||
public class WindEstimatorManeuverNumberDependentEvaluationRunner {
|
||||
|
||||
private static final Integer MAX_RACES = null;
|
||||
private static final int MAX_MANEUVERS = 10;
|
||||
private static final boolean EVALUATE_PER_COMPETITOR_TRACK = true;
|
||||
private static final boolean EVALUATE_PER_COMPETITOR_TRACK = false;
|
||||
private static final boolean ENABLE_MARKS_INFORMATION = false;
|
||||
private static final boolean ENABLE_SCALED_SPEED = false;
|
||||
private static final boolean ENABLE_POLARS = true;
|
||||
private static final double MIN_CORRECT_ESTIMATIONS_RATIO_FOR_CORRECT_RACE = 0.75;
|
||||
private static final double MAX_TWS_DEVIATION_PERCENT = 0.2;
|
||||
private static final int MAX_TWD_DEVIATION_DEG = 20;
|
||||
private static final EvaluatableWindEstimationImplementation WIND_ESTIMATION_IMPLEMENTATION = EvaluatableWindEstimationImplementation.HMM;
|
||||
private static final EvaluatableWindEstimationImplementation WIND_ESTIMATION_IMPLEMENTATION = EvaluatableWindEstimationImplementation.MST_HMM;
|
||||
|
||||
private static final File csvFile = new File(
|
||||
"maneuverNumberDependentEvaluation" + WIND_ESTIMATION_IMPLEMENTATION + ".csv");
|
||||
@@ -38,10 +38,10 @@ public class WindEstimatorManeuverNumberDependentEvaluationRunner {
|
||||
LoggingUtil.logInfo("Loading polar data");
|
||||
PolarDataService polarService = PolarDataServiceAccessUtil.getPersistedPolarService();
|
||||
LoggingUtil.logInfo("Wind estimator evaluation started...");
|
||||
ModelStore classifierModelStore = new MongoDbModelStoreImpl(persistenceManager.getDb());
|
||||
ModelStore modelStore = new FileSystemModelStoreImpl("trained_wind_estimation_models");
|
||||
// ModelStore modelStore = new MongoDbModelStoreImpl(persistenceManager.getDb());
|
||||
WindEstimatorFactories estimatorFactories = new WindEstimatorFactories(polarService,
|
||||
new ManeuverFeatures(ENABLE_POLARS, ENABLE_SCALED_SPEED, ENABLE_MARKS_INFORMATION),
|
||||
classifierModelStore);
|
||||
new ManeuverFeatures(ENABLE_POLARS, ENABLE_SCALED_SPEED, ENABLE_MARKS_INFORMATION), modelStore);
|
||||
|
||||
double[] avgErrorDegreesPerManeuverCount = new double[MAX_MANEUVERS];
|
||||
double[] avgConfidencePerManeuverCount = new double[MAX_MANEUVERS];
|
||||
|
||||
Reference in New Issue
Block a user