Changeset 18180 for branches/3138_Shape_Constraints_Transformations/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionPruningOperator.cs
- Timestamp:
- 01/10/22 10:15:25 (2 years ago)
- Location:
- branches/3138_Shape_Constraints_Transformations
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3138_Shape_Constraints_Transformations
- Property svn:mergeinfo changed
-
branches/3138_Shape_Constraints_Transformations/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression
- Property svn:mergeinfo changed
-
branches/3138_Shape_Constraints_Transformations/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4
- Property svn:mergeinfo changed
-
branches/3138_Shape_Constraints_Transformations/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionPruningOperator.cs
r17180 r18180 91 91 for (int i = 0; i < nodes.Count; ++i) { 92 92 var node = nodes[i]; 93 if (node is ConstantTreeNode) continue;93 if (node is INumericTreeNode) continue; // skip constants and numbers 94 94 95 double impactValue, replacementValue; 96 double newQualityForImpactsCalculation; 97 impactValuesCalculator.CalculateImpactAndReplacementValues(model, node, problemData, rows, out impactValue, out replacementValue, out newQualityForImpactsCalculation, qualityForImpactsCalculation); 95 impactValuesCalculator.CalculateImpactAndReplacementValues(model, node, problemData, rows, 96 out double impactValue, out double replacementValue, out double newQualityForImpactsCalculation, qualityForImpactsCalculation); 98 97 99 98 if (pruneOnlyZeroImpactNodes && !impactValue.IsAlmost(0.0)) continue; 100 99 if (!pruneOnlyZeroImpactNodes && impactValue > nodeImpactThreshold) continue; 101 100 102 var constantNode = (ConstantTreeNode)node.Grammar.GetSymbol("Constant").CreateTreeNode();103 constantNode.Value = replacementValue;101 var numNode = (NumberTreeNode)node.Grammar.GetSymbol("Number").CreateTreeNode(); 102 numNode.Value = replacementValue; 104 103 105 ReplaceWith Constant(node, constantNode);104 ReplaceWithNumber(node, numNode); 106 105 i += node.GetLength() - 1; // skip subtrees under the node that was folded 107 106
Note: See TracChangeset
for help on using the changeset viewer.