Changeset 18132 for trunk/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionPruningOperator.cs
- Timestamp:
- 12/15/21 11:50:57 (2 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/3140_NumberSymbol (added) merged: 18091,18093,18100,18112-18121,18123-18131
- Property svn:mergeinfo changed
-
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression
- Property svn:mergeinfo changed
/branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression (added) merged: 18093,18100,18113-18115,18117
- Property svn:mergeinfo changed
-
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4
- Property svn:mergeinfo changed
/branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4 (added) merged: 18093,18100,18113-18115,18117
- Property svn:mergeinfo changed
-
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionPruningOperator.cs
r17180 r18132 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.