- Timestamp:
- 07/14/10 10:45:41 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/InteractiveSymbolicRegressionSolutionSimplifierView.cs
r3985 r4034 91 91 root.AddSubTree(start); 92 92 start.AddSubTree(simplifiedExpressionTree.Root); 93 int samplesStart = Content.ProblemData.TrainingSamplesStart.Value; 94 int samplesEnd = Content.ProblemData.TrainingSamplesEnd.Value; 93 95 double originalTrainingMeanSquaredError = SymbolicRegressionMeanSquaredErrorEvaluator.Calculate( 94 96 Content.Model.Interpreter, new SymbolicExpressionTree(root), Content.LowerEstimationLimit, Content.UpperEstimationLimit, 95 97 Content.ProblemData.Dataset, Content.ProblemData.TargetVariable.Value, 96 Content.ProblemData.TrainingSamplesStart.Value, Content.ProblemData.TrainingSamplesEnd.Value);98 Enumerable.Range(samplesStart, samplesEnd - samplesStart)); 97 99 98 100 this.CalculateReplacementNodes(); … … 112 114 SymbolicExpressionTree tree = new SymbolicExpressionTree(root); 113 115 foreach (SymbolicExpressionTreeNode node in this.simplifiedExpressionTree.IterateNodesPrefix()) { 114 while (start.SubTrees.Count > 0) start.RemoveSubTree(0);116 while (start.SubTrees.Count > 0) start.RemoveSubTree(0); 115 117 start.AddSubTree(node); 116 118 double constantTreeNodeValue = interpreter.GetSymbolicExpressionTreeValues(tree, Content.ProblemData.Dataset, trainingSamples).Median(); … … 123 125 foreach (SymbolicExpressionTreeNode childNode in currentTreeNode.SubTrees.ToList()) { 124 126 SwitchNode(currentTreeNode, childNode, replacementNodes[childNode]); 127 int samplesStart = Content.ProblemData.TrainingSamplesStart.Value; 128 int samplesEnd = Content.ProblemData.TrainingSamplesEnd.Value; 125 129 double newTrainingMeanSquaredError = SymbolicRegressionMeanSquaredErrorEvaluator.Calculate( 126 130 Content.Model.Interpreter, tree, 127 131 Content.LowerEstimationLimit, Content.UpperEstimationLimit, 128 132 Content.ProblemData.Dataset, Content.ProblemData.TargetVariable.Value, 129 Content.ProblemData.TrainingSamplesStart.Value, Content.ProblemData.TrainingSamplesEnd.Value);133 Enumerable.Range(samplesStart, samplesEnd - samplesStart)); 130 134 nodeImpacts[childNode] = newTrainingMeanSquaredError / originalTrainingMeanSquaredError; 131 135 SwitchNode(currentTreeNode, replacementNodes[childNode], childNode);
Note: See TracChangeset
for help on using the changeset viewer.