Changeset 7234 for trunk/sources
- Timestamp:
- 12/25/11 21:29:10 (13 years ago)
- Location:
- trunk/sources
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/InteractiveSymbolicDiscriminantFunctionClassificationSolutionSimplifierView.cs
r7233 r7234 78 78 .LimitToRange(Content.Model.LowerEstimationLimit, Content.Model.UpperEstimationLimit) 79 79 .ToArray(); 80 double[] classValues;81 double[] thresholds;82 // normal distribution cut points are used as thresholds here because they are a lot faster to calculate than the accuracy maximizing thresholds83 AccuracyMaximizationThresholdCalculator.CalculateThresholds(Content.ProblemData, originalOutput, targetClassValues, out classValues, out thresholds);84 var classifier = new SymbolicDiscriminantFunctionClassificationModel(tree, interpreter);85 classifier.SetThresholdsAndClassValues(thresholds, classValues);86 80 OnlineCalculatorError errorState; 87 double original Accuracy = OnlineAccuracyCalculator.Calculate(targetClassValues, classifier.GetEstimatedClassValues(dataset, rows), out errorState);88 if (errorState != OnlineCalculatorError.None) original Accuracy= 0.0;81 double originalGini = NormalizedGiniCalculator.Calculate(targetClassValues, originalOutput, out errorState); 82 if (errorState != OnlineCalculatorError.None) originalGini = 0.0; 89 83 90 84 foreach (ISymbolicExpressionTreeNode node in nodes) { … … 96 90 .LimitToRange(Content.Model.LowerEstimationLimit, Content.Model.UpperEstimationLimit) 97 91 .ToArray(); 98 AccuracyMaximizationThresholdCalculator.CalculateThresholds(Content.ProblemData, newOutput, targetClassValues, out classValues, out thresholds); 99 classifier = new SymbolicDiscriminantFunctionClassificationModel(tree, interpreter); 100 classifier.SetThresholdsAndClassValues(thresholds, classValues); 101 double newAccuracy = OnlineAccuracyCalculator.Calculate(targetClassValues, classifier.GetEstimatedClassValues(dataset, rows), out errorState); 102 if (errorState != OnlineCalculatorError.None) newAccuracy = 0.0; 92 double newGini = NormalizedGiniCalculator.Calculate(targetClassValues, newOutput, out errorState); 93 if (errorState != OnlineCalculatorError.None) newGini = 0.0; 103 94 104 95 // impact = 0 if no change 105 96 // impact < 0 if new solution is better 106 97 // impact > 0 if new solution is worse 107 impactValues[node] = original Accuracy - newAccuracy;98 impactValues[node] = originalGini - newGini; 108 99 SwitchNode(parent, replacementNode, node); 109 100 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicDiscriminantFunctionClassificationSolution.cs
r6589 r7234 79 79 ModelDepth = Model.SymbolicExpressionTree.Depth; 80 80 } 81 82 81 } 83 82 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/DiscriminantFunctionClassificationSolutionBase.cs
r6961 r7234 157 157 protected virtual void OnModelThresholdsChanged(EventArgs e) { 158 158 CalculateResults(); 159 CalculateRegressionResults(); 159 160 } 160 161
Note: See TracChangeset
for help on using the changeset viewer.