Changeset 4722 for trunk/sources/HeuristicLab.Problems.DataAnalysis.Classification/3.3/Symbolic/SymbolicClassificationSolution.cs
- Timestamp:
- 11/06/10 01:56:04 (14 years ago)
- Location:
- trunk/sources
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources
- Property svn:mergeinfo changed
/branches/CloningRefactoring (added) merged: 4656-4693,4696-4697,4711-4714,4718-4719
- Property svn:mergeinfo changed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Classification/3.3/Symbolic/SymbolicClassificationSolution.cs
r4469 r4722 35 35 [StorableClass] 36 36 public class SymbolicClassificationSolution : SymbolicRegressionSolution, IClassificationSolution { 37 private SymbolicClassificationSolution() : base() { } 37 public new ClassificationProblemData ProblemData { 38 get { return (ClassificationProblemData)base.ProblemData; } 39 set { base.ProblemData = value; } 40 } 41 42 #region properties 43 private List<double> optimalThresholds; 44 private List<double> actualThresholds; 45 public IEnumerable<double> Thresholds { 46 get { 47 if (actualThresholds == null) RecalculateEstimatedValues(); 48 return actualThresholds; 49 } 50 set { 51 if (actualThresholds != null && actualThresholds.SequenceEqual(value)) 52 return; 53 actualThresholds = new List<double>(value); 54 OnThresholdsChanged(); 55 } 56 } 57 58 public IEnumerable<double> EstimatedClassValues { 59 get { return GetEstimatedClassValues(Enumerable.Range(0, ProblemData.Dataset.Rows)); } 60 } 61 62 public IEnumerable<double> EstimatedTrainingClassValues { 63 get { return GetEstimatedClassValues(ProblemData.TrainingIndizes); } 64 } 65 66 public IEnumerable<double> EstimatedTestClassValues { 67 get { return GetEstimatedClassValues(ProblemData.TestIndizes); } 68 } 69 70 [StorableConstructor] 71 protected SymbolicClassificationSolution(bool deserializing) : base(deserializing) { } 72 protected SymbolicClassificationSolution(SymbolicClassificationSolution original, Cloner cloner) : base(original, cloner) { } 38 73 public SymbolicClassificationSolution(ClassificationProblemData problemData, SymbolicRegressionModel model, double lowerEstimationLimit, double upperEstimationLimit) 39 74 : base(problemData, model, lowerEstimationLimit, upperEstimationLimit) { 40 75 } 41 76 42 public new ClassificationProblemData ProblemData { 43 get { return (ClassificationProblemData)base.ProblemData; } 44 set { base.ProblemData = value; } 77 public override IDeepCloneable Clone(Cloner cloner) { 78 return new SymbolicClassificationSolution(this, cloner); 45 79 } 46 80 … … 114 148 } 115 149 116 #region properties117 private List<double> optimalThresholds;118 private List<double> actualThresholds;119 public IEnumerable<double> Thresholds {120 get {121 if (actualThresholds == null) RecalculateEstimatedValues();122 return actualThresholds;123 }124 set {125 if (actualThresholds != null && actualThresholds.SequenceEqual(value))126 return;127 actualThresholds = new List<double>(value);128 OnThresholdsChanged();129 }130 }131 132 public IEnumerable<double> EstimatedClassValues {133 get { return GetEstimatedClassValues(Enumerable.Range(0, ProblemData.Dataset.Rows)); }134 }135 136 public IEnumerable<double> EstimatedTrainingClassValues {137 get { return GetEstimatedClassValues(ProblemData.TrainingIndizes); }138 }139 140 public IEnumerable<double> EstimatedTestClassValues {141 get { return GetEstimatedClassValues(ProblemData.TestIndizes); }142 }143 144 150 public IEnumerable<double> GetEstimatedClassValues(IEnumerable<int> rows) { 145 151 double[] classValues = ProblemData.SortedClassValues.ToArray();
Note: See TracChangeset
for help on using the changeset viewer.