Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/03/12 17:36:20 (12 years ago)
Author:
gkronber
Message:

#1847: fixed some bugs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GP-MoveOperators/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/ReplaceBranchMultiMoveGenerator.cs

    r8206 r8207  
    112112      base.ClearState();
    113113    }
     114    public override void InitializeState() {
     115      trees = null;
     116      treeOutput = null;
     117      base.InitializeState();
     118    }
    114119
    115120    public override IOperation Apply() {
     
    149154      var interpreter = SymbolicDataAnalysisTreeInterpreterParameter.ActualValue;
    150155      var ds = ProblemDataParameter.ActualValue.Dataset;
    151       var rows = ProblemDataParameter.ActualValue.TrainingIndizes;
     156      var rows = ProblemDataParameter.ActualValue.TrainingIndices;
    152157
    153158      while (count < n) {
     
    160165
    161166        var bestTrees = new SortedList<double, Tuple<ISymbolicExpressionTree, double[]>>();
    162         double bestSimilarity = 0.0;
     167        double bestSimilarity = 0;
    163168        // iterate over the whole pool of branches for replacement
    164169        for (int i = 0; i < trees.Count; i++) {
     
    175180              bestTrees.Add(similarity, Tuple.Create(trees[i], treeOutput[i]));
    176181              if (bestTrees.Count > 30)
    177                 bestTrees.RemoveAt(bestTrees.Count - 1);
     182                bestTrees.RemoveAt(0); // remove moves with small R² at the beginning
     183
    178184            }
    179185          }
     
    206212      var interpreter = SymbolicDataAnalysisTreeInterpreterParameter.ActualValue;
    207213      var ds = ProblemDataParameter.ActualValue.Dataset;
    208       var rows = ProblemDataParameter.ActualValue.TrainingIndizes;
     214      var rows = ProblemDataParameter.ActualValue.TrainingIndices;
    209215      // create pool of random branches for replacement (no constants)
    210216      // and evaluate the output
Note: See TracChangeset for help on using the changeset viewer.