Changeset 5717 for branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs
- Timestamp:
- 03/16/11 16:34:31 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs
r5699 r5717 88 88 simplifiedExpressionTree = simplifier.Simplify(Content.Model.SymbolicExpressionTree); 89 89 90 var replacementValues = CalculateReplacementValues( Content.Model.Interpreter, simplifiedExpressionTree, Content.ProblemData.Dataset, Content.ProblemData.TrainingIndizes);90 var replacementValues = CalculateReplacementValues(simplifiedExpressionTree); 91 91 foreach (var pair in replacementValues) { 92 92 replacementNodes.Add(pair.Key, MakeConstantTreeNode(pair.Value)); 93 93 } 94 nodeImpacts = CalculateImpactValues( Content.Model.Interpreter, simplifiedExpressionTree, Content.ProblemData.Dataset, Content.ProblemData.TrainingIndizes);94 nodeImpacts = CalculateImpactValues(simplifiedExpressionTree); 95 95 96 96 // automatically fold all branches with impact = 1 … … 110 110 } 111 111 112 protected abstract Dictionary<ISymbolicExpressionTreeNode, double> CalculateReplacementValues(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree tree, Dataset dataset, IEnumerable<int> rows); 113 protected abstract Dictionary<ISymbolicExpressionTreeNode, double> CalculateImpactValues(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree tree, Dataset dataset, IEnumerable<int> rows); 112 protected abstract Dictionary<ISymbolicExpressionTreeNode, double> CalculateReplacementValues(ISymbolicExpressionTree tree); 113 protected abstract Dictionary<ISymbolicExpressionTreeNode, double> CalculateImpactValues(ISymbolicExpressionTree tree); 114 protected abstract void UpdateModel(ISymbolicExpressionTree tree); 114 115 115 116 private ConstantTreeNode MakeConstantTreeNode(double value) { … … 137 138 138 139 SymbolicExpressionTree tree = (SymbolicExpressionTree)simplifiedExpressionTree.Clone(); 139 140 //this.Content.ModelChanged -= new EventHandler(Content_ModelChanged); 141 //this.Content.Model = new SymbolicRegressionModel(Content.Model.Interpreter, tree); 142 //this.Content.ModelChanged += new EventHandler(Content_ModelChanged); 143 140 UpdateModel(tree); 144 141 this.PaintNodeImpacts(); 145 142 } … … 166 163 VisualSymbolicExpressionTreeNode visualTree = treeChart.GetVisualSymbolicExpressionTreeNode(treeNode); 167 164 168 //if (impact < 1.0) { 169 // visualTree.FillColor = Color.FromArgb((int)((1.0 - impact) * 255), Color.Red); 170 //} else { 171 visualTree.FillColor = Color.FromArgb((int)((impact - 1.0) / max * 255), Color.Green); 172 //} 165 // impact = 0 if no change 166 // impact < 0 if new solution is better 167 // impact > 0 if new solution is worse 168 if (impact < 0.0) { 169 visualTree.FillColor = Color.FromArgb((int)(impact / min * 255), Color.Red); 170 } else { 171 visualTree.FillColor = Color.FromArgb((int)(impact / max * 255), Color.Green); 172 } 173 173 visualTree.ToolTip += Environment.NewLine + "Node impact: " + impact; 174 174 visualTree.ToolTip += Environment.NewLine + "Replacement value: " + replacementValue;
Note: See TracChangeset
for help on using the changeset viewer.