Changeset 12359 for trunk/sources
- Timestamp:
- 04/29/15 11:59:18 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionPruningOperator.cs
r12358 r12359 170 170 } 171 171 172 //public ISymbolicExpressionTree Prune(ISymbolicExpressionTree tree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, IDataAnalysisProblemData problemData, DoubleLimit estimationLimits) {173 // var model = CreateModel((ISymbolicExpressionTree)tree.Clone(), interpreter, problemData, estimationLimits);174 // var nodes = tree.Root.GetSubtree(0).GetSubtree(0).IterateNodesPrefix().ToList();175 // var rows = Enumerable.Range(fitnessCalculationPartition.Start, fitnessCalculationPartition.Size);176 177 // double quality = Evaluate(model);178 179 // for (int i = 0; i < nodes.Count; ++i) {180 // var node = nodes[i];181 // if (node is ConstantTreeNode) continue;182 183 // double impactValue, replacementValue;184 // ImpactValuesCalculator.CalculateImpactAndReplacementValues(model, node, problemData, rows, out impactValue, out replacementValue, quality);185 186 // if (PruneOnlyZeroImpactNodes) {187 // if (!impactValue.IsAlmost(0.0)) continue;188 // } else if (NodeImpactThreshold < impactValue) {189 // continue;190 // }191 192 // var constantNode = (ConstantTreeNode)node.Grammar.GetSymbol("Constant").CreateTreeNode();193 // constantNode.Value = replacementValue;194 195 // ReplaceWithConstant(node, constantNode);196 // i += node.GetLength() - 1; // skip subtrees under the node that was folded197 198 // quality -= impactValue;199 // }200 // return model.SymbolicExpressionTree;201 //}202 203 172 protected static void ReplaceWithConstant(ISymbolicExpressionTreeNode original, ISymbolicExpressionTreeNode replacement) { 204 173 var parent = original.Parent;
Note: See TracChangeset
for help on using the changeset viewer.