Free cookie consent management tool by TermsFeed Policy Generator

Changeset 9164


Ignore:
Timestamp:
01/15/13 13:56:48 (12 years ago)
Author:
mkommend
Message:

#1837: Added validation to sliding window algorithms.

Location:
branches/Sliding Window GP
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SlidingWindow/SlidingWindowAnalyzer.cs

    r9162 r9164  
    3232    private const string ProblemDataParameterName = "ProblemData";
    3333    private const string FitnessCalculationPartitionParameterName = "FitnessCalculationPartition";
     34    private const string ValidationPartitionParameterName = "ValidationPartition";
    3435    private const string SlidingWindowSizeParameterName = "Sliding Window Size";
     36    private const string ValidationSlidingWindowSizeParameterName = "Validation Sliding Window Size";
    3537    private const string SlidingWindowStepWidthParameterName = "Sliding Window Step Width";
    3638    private const string InitialSlidingWindowParameterName = "Initial Sliding Window";
     
    4446      get { return (ILookupParameter<IntRange>)Parameters[FitnessCalculationPartitionParameterName]; }
    4547    }
     48    public ILookupParameter<IntRange> ValidationPartitionParameter {
     49      get { return (ILookupParameter<IntRange>)Parameters[ValidationPartitionParameterName]; }
     50    }
    4651    public IFixedValueParameter<IntValue> SlidingWindowSizeParameter {
    4752      get { return (IFixedValueParameter<IntValue>)Parameters[SlidingWindowSizeParameterName]; }
     53    }
     54    public IFixedValueParameter<IntValue> ValidationSlidingWindowSizeParameter {
     55      get { return (IFixedValueParameter<IntValue>)Parameters[ValidationSlidingWindowSizeParameterName]; }
    4856    }
    4957    public IFixedValueParameter<IntValue> SlidingWindowStepWidthParameter {
     
    6169    public override bool EnabledByDefault { get { return false; } }
    6270    public IntValue SlidingWindowSize { get { return SlidingWindowSizeParameter.Value; } }
     71    public IntValue ValidiationSlidingWindowSize { get { return ValidationSlidingWindowSizeParameter.Value; } }
    6372    public IntValue SlidingWindowStepWidth { get { return SlidingWindowStepWidthParameter.Value; } }
    6473    public IntRange InitialSlidingWindow { get { return InitialSlidingWindowParameter.Value; } }
     
    7584      Parameters.Add(new ValueLookupParameter<IDataAnalysisProblemData>(ProblemDataParameterName, "The problem data on which the symbolic data analysis solution should be evaluated."));
    7685      Parameters.Add(new LookupParameter<IntRange>(FitnessCalculationPartitionParameterName, ""));
     86      Parameters.Add(new LookupParameter<IntRange>(ValidationPartitionParameterName, ""));
    7787      Parameters.Add(new FixedValueParameter<IntValue>(SlidingWindowSizeParameterName, "", new IntValue(1)));
     88      Parameters.Add(new FixedValueParameter<IntValue>(ValidationSlidingWindowSizeParameterName, "", new IntValue(0)));
    7889      Parameters.Add(new FixedValueParameter<IntValue>(SlidingWindowStepWidthParameterName, "", new IntValue(1)));
    7990      Parameters.Add(new FixedValueParameter<IntRange>(InitialSlidingWindowParameterName, "", new IntRange(0, 1)));
     
    8899        TerminateSlidingWindowParameter.ActualValue = new BoolValue(false);
    89100        FitnessCalculationPartitionParameter.ActualValue = (IntRange)InitialSlidingWindow.Clone();
     101        ValidationPartitionParameter.ActualValue = new IntRange(InitialSlidingWindow.End, InitialSlidingWindow.End + ValidiationSlidingWindowSize.Value);
    90102        return base.Apply();
    91103      }
     
    108120        FitnessCalculationPartitionParameter.ActualValue.Start = fitnessPartition.Start;
    109121        FitnessCalculationPartitionParameter.ActualValue.End = fitnessPartition.End;
     122        ValidationPartitionParameter.ActualValue.Start = fitnessPartition.End;
     123        ValidationPartitionParameter.ActualValue.End = ValidationPartitionParameter.ActualValue.Start + ValidiationSlidingWindowSize.Value;
    110124      }
    111125
Note: See TracChangeset for help on using the changeset viewer.