Changeset 11145 for stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicClassificationSolutionImpactValuesCalculator.cs
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 10368,10375,10378,10414,10417-10418,10428,10469-10470,11013,11025-11027
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification merged: 10368,10375,10378,10418,10469,11025-11026
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicClassificationSolutionImpactValuesCalculator.cs
r10281 r11145 20 20 #endregion 21 21 22 using System; 22 23 using System.Collections.Generic; 23 24 using HeuristicLab.Common; 25 using HeuristicLab.Core; 24 26 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 28 26 29 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification { 30 [StorableClass] 31 [Item("SymbolicClassificationSolutionImpactValuesCalculator", "Calculate symbolic expression tree node impact values for classification problems.")] 27 32 public class SymbolicClassificationSolutionImpactValuesCalculator : SymbolicDataAnalysisSolutionImpactValuesCalculator { 33 public SymbolicClassificationSolutionImpactValuesCalculator() { } 34 protected SymbolicClassificationSolutionImpactValuesCalculator(SymbolicClassificationSolutionImpactValuesCalculator original, Cloner cloner) 35 : base(original, cloner) { } 36 public override IDeepCloneable Clone(Cloner cloner) { 37 return new SymbolicClassificationSolutionImpactValuesCalculator(this, cloner); 38 } 39 [StorableConstructor] 40 protected SymbolicClassificationSolutionImpactValuesCalculator(bool deserializing) : base(deserializing) { } 41 28 42 public override double CalculateReplacementValue(ISymbolicDataAnalysisModel model, ISymbolicExpressionTreeNode node, IDataAnalysisProblemData problemData, IEnumerable<int> rows) { 29 43 var classificationModel = (ISymbolicClassificationModel)model; … … 34 48 35 49 public override double CalculateImpactValue(ISymbolicDataAnalysisModel model, ISymbolicExpressionTreeNode node, IDataAnalysisProblemData problemData, IEnumerable<int> rows, double originalQuality = double.NaN) { 50 double impactValue, replacementValue; 51 CalculateImpactAndReplacementValues(model, node, problemData, rows, out impactValue, out replacementValue, originalQuality); 52 return impactValue; 53 } 54 55 public override void CalculateImpactAndReplacementValues(ISymbolicDataAnalysisModel model, ISymbolicExpressionTreeNode node, 56 IDataAnalysisProblemData problemData, IEnumerable<int> rows, out double impactValue, out double replacementValue, 57 double originalQuality = Double.NaN) { 36 58 var classificationModel = (ISymbolicClassificationModel)model; 37 59 var classificationProblemData = (IClassificationProblemData)problemData; … … 47 69 } 48 70 49 varreplacementValue = CalculateReplacementValue(classificationModel, node, classificationProblemData, rows);71 replacementValue = CalculateReplacementValue(classificationModel, node, classificationProblemData, rows); 50 72 var constantNode = new ConstantTreeNode(new Constant()) { Value = replacementValue }; 51 73 … … 63 85 if (errorState != OnlineCalculatorError.None) newQuality = 0.0; 64 86 65 returnoriginalQuality - newQuality;87 impactValue = originalQuality - newQuality; 66 88 } 67 68 89 } 69 90 }
Note: See TracChangeset
for help on using the changeset viewer.