Free cookie consent management tool by TermsFeed Policy Generator

Changeset 481 for trunk/sources


Ignore:
Timestamp:
08/10/08 11:57:49 (16 years ago)
Author:
gkronber
Message:

fixed another small bug (#242 All GP evaluators should support the 'UseEstimatedTargetValues' switch for autoregressive modelling)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.StructureIdentification/Evaluation/GPEvaluatorBase.cs

    r480 r481  
    6969      treeSize = scope.GetVariableValue<IntData>("TreeSize", false).Data;
    7070      totalEvaluatedNodes = scope.GetVariableValue<DoubleData>("TotalEvaluatedNodes", true).Data;
    71       trainingStart = GetVariableValue<IntData>("TrainingSamplesStart", scope, true).Data;
    72       trainingEnd = GetVariableValue<IntData>("TrainingSamplesEnd", scope, true).Data;
     71      int trainingStart = GetVariableValue<IntData>("TrainingSamplesStart", scope, true).Data;
     72      int trainingEnd = GetVariableValue<IntData>("TrainingSamplesEnd", scope, true).Data;
    7373      useEstimatedValues = GetVariableValue<BoolData>("UseEstimatedTargetValue", scope, true).Data;
    7474      // prepare for autoregressive modelling by saving the original values of the target-variable to a backup array
    75       if(useEstimatedValues && backupValues == null) {
     75      if(useEstimatedValues &&
     76        (backupValues == null || trainingStart!=this.trainingStart || trainingEnd!=this.trainingEnd)) {
     77        this.trainingStart = trainingStart;
     78        this.trainingEnd = trainingEnd;
    7679        backupValues = new double[trainingEnd - trainingStart];
    7780        for(int i = trainingStart; i < trainingEnd; i++) {
Note: See TracChangeset for help on using the changeset viewer.