Changeset 8207 for branches/GP-MoveOperators/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/ReplaceBranchMultiMoveGenerator.cs
- Timestamp:
- 07/03/12 17:36:20 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GP-MoveOperators/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/ReplaceBranchMultiMoveGenerator.cs
r8206 r8207 112 112 base.ClearState(); 113 113 } 114 public override void InitializeState() { 115 trees = null; 116 treeOutput = null; 117 base.InitializeState(); 118 } 114 119 115 120 public override IOperation Apply() { … … 149 154 var interpreter = SymbolicDataAnalysisTreeInterpreterParameter.ActualValue; 150 155 var ds = ProblemDataParameter.ActualValue.Dataset; 151 var rows = ProblemDataParameter.ActualValue.TrainingIndi zes;156 var rows = ProblemDataParameter.ActualValue.TrainingIndices; 152 157 153 158 while (count < n) { … … 160 165 161 166 var bestTrees = new SortedList<double, Tuple<ISymbolicExpressionTree, double[]>>(); 162 double bestSimilarity = 0 .0;167 double bestSimilarity = 0; 163 168 // iterate over the whole pool of branches for replacement 164 169 for (int i = 0; i < trees.Count; i++) { … … 175 180 bestTrees.Add(similarity, Tuple.Create(trees[i], treeOutput[i])); 176 181 if (bestTrees.Count > 30) 177 bestTrees.RemoveAt(bestTrees.Count - 1); 182 bestTrees.RemoveAt(0); // remove moves with small R² at the beginning 183 178 184 } 179 185 } … … 206 212 var interpreter = SymbolicDataAnalysisTreeInterpreterParameter.ActualValue; 207 213 var ds = ProblemDataParameter.ActualValue.Dataset; 208 var rows = ProblemDataParameter.ActualValue.TrainingIndi zes;214 var rows = ProblemDataParameter.ActualValue.TrainingIndices; 209 215 // create pool of random branches for replacement (no constants) 210 216 // and evaluate the output
Note: See TracChangeset
for help on using the changeset viewer.