Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/12/12 14:27:49 (12 years ago)
Author:
mkommend
Message:

#1081: Updated estimation limits correctly in TimeSeriesPrognosisProblem.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis/3.4/SingleObjective/SymbolicTimeSeriesPrognosisSingleObjectiveProblem.cs

    r7989 r7991  
    3131  [Creatable("Problems")]
    3232  public class SymbolicTimeSeriesPrognosisSingleObjectiveProblem : SymbolicDataAnalysisSingleObjectiveProblem<ITimeSeriesPrognosisProblemData, ISymbolicTimeSeriesPrognosisSingleObjectiveEvaluator, ISymbolicDataAnalysisSolutionCreator>, ITimeSeriesPrognosisProblem {
     33    private const double PunishmentFactor = 10;
    3334    private const int InitialMaximumTreeDepth = 8;
    3435    private const int InitialMaximumTreeLength = 25;
     
    8485
    8586    private void UpdateEstimationLimits() {
    86       EstimationLimits.Upper = double.MaxValue;
    87       EstimationLimits.Lower = double.MinValue;
     87      if (ProblemData.TrainingIndizes.Any()) {
     88        var targetValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes).ToList();
     89        var mean = targetValues.Average();
     90        var range = targetValues.Max() - targetValues.Min();
     91        EstimationLimits.Upper = mean + PunishmentFactor * range;
     92        EstimationLimits.Lower = mean - PunishmentFactor * range;
     93      } else {
     94        EstimationLimits.Upper = double.MaxValue;
     95        EstimationLimits.Lower = double.MinValue;
     96      }
    8897    }
    8998
Note: See TracChangeset for help on using the changeset viewer.