Free cookie consent management tool by TermsFeed Policy Generator

Changeset 7991


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

#1081: Updated estimation limits correctly in TimeSeriesPrognosisProblem.

Location:
branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis/3.4
Files:
2 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
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis/3.4/SymbolicTimeSeriesPrognosisExpressionTreeInterpreter.cs

    r7989 r7991  
    9999
    100100        int j = 0;
    101         foreach (var targetValue in dataset.GetDoubleValues(TargetVariable, invalidateCacheIndexes)) {
     101        foreach (var targetValue in dataset.GetDoubleValues(targetVariable, invalidateCacheIndexes)) {
    102102          targetVariableCache[invalidateCacheIndexes[j]] = targetValue;
    103103          j++;
Note: See TracChangeset for help on using the changeset viewer.