- Timestamp:
- 11/06/10 01:56:04 (14 years ago)
- Location:
- trunk/sources
- Files:
-
- 6 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/Analyzer/ValidationBestSymbolicClassificationSolutionAnalyzer.cs
r4469 r4722 23 23 using System.Linq; 24 24 using HeuristicLab.Analysis; 25 using HeuristicLab.Common; 25 26 using HeuristicLab.Core; 26 27 using HeuristicLab.Data; … … 180 181 #endregion 181 182 183 [StorableConstructor] 184 protected ValidationBestSymbolicClassificationSolutionAnalyzer(bool deserializing) : base(deserializing) { } 185 protected ValidationBestSymbolicClassificationSolutionAnalyzer(ValidationBestSymbolicClassificationSolutionAnalyzer original, Cloner cloner) 186 : base(original, cloner) { 187 } 182 188 public ValidationBestSymbolicClassificationSolutionAnalyzer() 183 189 : base() { … … 204 210 } 205 211 206 [StorableConstructor] 207 private ValidationBestSymbolicClassificationSolutionAnalyzer(bool deserializing) : base(deserializing) { } 212 public override IDeepCloneable Clone(Cloner cloner) { 213 return new ValidationBestSymbolicClassificationSolutionAnalyzer(this, cloner); 214 } 208 215 209 216 public override IOperation Apply() { … … 304 311 } 305 312 } 306 307 313 } 308 314 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Classification/3.3/Symbolic/Evaluators/SymbolicClassificationMeanSquaredErrorEvaluator.cs
r4391 r4722 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 27 28 [Item("SymbolicClassificationMeanSquaredErrorEvaluator", "Calculates the mean squared error of a symbolic classification solution.")] 28 29 [StorableClass] 29 public class SymbolicClassifacitionMeanSquaredErrorEvaluator : SymbolicRegressionMeanSquaredErrorEvaluator, ISymbolicClassificationEvaluator {30 public sealed class SymbolicClassifacitionMeanSquaredErrorEvaluator : SymbolicRegressionMeanSquaredErrorEvaluator, ISymbolicClassificationEvaluator { 30 31 public ClassificationProblemData ClassificationProblemData { 31 32 get { return (ClassificationProblemData)RegressionProblemData; } 32 33 } 33 34 34 public SymbolicClassifacitionMeanSquaredErrorEvaluator() 35 : base() { 35 [StorableConstructor] 36 private SymbolicClassifacitionMeanSquaredErrorEvaluator(bool deserializing) : base(deserializing) { } 37 private SymbolicClassifacitionMeanSquaredErrorEvaluator(SymbolicClassifacitionMeanSquaredErrorEvaluator original, Cloner cloner) : base(original, cloner) { } 38 public SymbolicClassifacitionMeanSquaredErrorEvaluator() : base() { } 39 public override IDeepCloneable Clone(Cloner cloner) { 40 return new SymbolicClassifacitionMeanSquaredErrorEvaluator(this, cloner); 36 41 } 37 42 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Classification/3.3/Symbolic/Evaluators/SymbolicClassificationPearsonRSquaredEvaluator.cs
r4392 r4722 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 27 28 [Item("SymbolicClassificationPearsonRSquaredEvaluator", "Calculates the pearson R² correlation coefficient of a symbolic classification solution.")] 28 29 [StorableClass] 29 public class SymbolicClassificationPearsonRSquaredEvaluator : SymbolicRegressionPearsonsRSquaredEvaluator, ISymbolicClassificationEvaluator {30 public sealed class SymbolicClassificationPearsonRSquaredEvaluator : SymbolicRegressionPearsonsRSquaredEvaluator, ISymbolicClassificationEvaluator { 30 31 public ClassificationProblemData ClassificationProblemData { 31 32 get { return (ClassificationProblemData)RegressionProblemData; } 32 33 } 33 34 34 public SymbolicClassificationPearsonRSquaredEvaluator() 35 : base() { 35 [StorableConstructor] 36 private SymbolicClassificationPearsonRSquaredEvaluator(bool deserializing) : base(deserializing) { } 37 private SymbolicClassificationPearsonRSquaredEvaluator(SymbolicClassificationPearsonRSquaredEvaluator original, Cloner cloner) : base(original, cloner) { } 38 public SymbolicClassificationPearsonRSquaredEvaluator() : base() { } 39 40 public override IDeepCloneable Clone(Cloner cloner) { 41 return new SymbolicClassificationPearsonRSquaredEvaluator(this, cloner); 36 42 } 37 43 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Classification/3.3/Symbolic/SymbolicClassificationProblem.cs
r4452 r4722 42 42 [StorableClass] 43 43 [Creatable("Problems")] 44 public class SymbolicClassificationProblem : SingleObjectiveClassificationProblem<ISymbolicClassificationEvaluator, ISymbolicExpressionTreeCreator>, IStorableContent {44 public sealed class SymbolicClassificationProblem : SingleObjectiveClassificationProblem<ISymbolicClassificationEvaluator, ISymbolicExpressionTreeCreator>, IStorableContent { 45 45 private const string SymbolicExpressionTreeInterpreterParameterName = "SymbolicExpressionTreeInterpreter"; 46 46 private const string FunctionTreeGrammarParameterName = "FunctionTreeGrammar"; … … 57 57 public ISymbolicExpressionTreeInterpreter SymbolicExpressionTreeInterpreter { 58 58 get { return SymbolicExpressionTreeInterpreterParameter.Value; } 59 pr otectedset { SymbolicExpressionTreeInterpreterParameter.Value = value; }59 private set { SymbolicExpressionTreeInterpreterParameter.Value = value; } 60 60 } 61 61 public IValueParameter<ISymbolicExpressionTreeInterpreter> SymbolicExpressionTreeInterpreterParameter { … … 65 65 public ISymbolicExpressionGrammar FunctionTreeGrammar { 66 66 get { return (ISymbolicExpressionGrammar)FunctionTreeGrammarParameter.Value; } 67 pr otectedset { FunctionTreeGrammarParameter.Value = value; }67 private set { FunctionTreeGrammarParameter.Value = value; } 68 68 } 69 69 public IValueParameter<ISymbolicExpressionGrammar> FunctionTreeGrammarParameter { … … 73 73 public IntValue MaxExpressionLength { 74 74 get { return MaxExpressionLengthParameter.Value; } 75 pr otectedset { MaxExpressionLengthParameter.Value = value; }75 private set { MaxExpressionLengthParameter.Value = value; } 76 76 } 77 77 public IValueParameter<IntValue> MaxExpressionLengthParameter { … … 81 81 public IntValue MaxExpressionDepth { 82 82 get { return MaxExpressionDepthParameter.Value; } 83 pr otectedset { MaxExpressionDepthParameter.Value = value; }83 private set { MaxExpressionDepthParameter.Value = value; } 84 84 } 85 85 public ValueParameter<IntValue> MaxExpressionDepthParameter { … … 89 89 public DoubleValue UpperEstimationLimit { 90 90 get { return UpperEstimationLimitParameter.Value; } 91 pr otectedset { UpperEstimationLimitParameter.Value = value; }91 private set { UpperEstimationLimitParameter.Value = value; } 92 92 } 93 93 public IValueParameter<DoubleValue> UpperEstimationLimitParameter { … … 97 97 public DoubleValue LowerEstimationLimit { 98 98 get { return LowerEstimationLimitParameter.Value; } 99 pr otectedset { LowerEstimationLimitParameter.Value = value; }99 private set { LowerEstimationLimitParameter.Value = value; } 100 100 } 101 101 public IValueParameter<DoubleValue> LowerEstimationLimitParameter { … … 105 105 public IntValue MaxFunctionDefiningBranches { 106 106 get { return MaxFunctionDefiningBranchesParameter.Value; } 107 pr otectedset { MaxFunctionDefiningBranchesParameter.Value = value; }107 private set { MaxFunctionDefiningBranchesParameter.Value = value; } 108 108 } 109 109 public IValueParameter<IntValue> MaxFunctionDefiningBranchesParameter { … … 113 113 public IntValue MaxFunctionArguments { 114 114 get { return MaxFunctionArgumentsParameter.Value; } 115 pr otectedset { MaxFunctionArgumentsParameter.Value = value; }115 private set { MaxFunctionArgumentsParameter.Value = value; } 116 116 } 117 117 public IValueParameter<IntValue> MaxFunctionArgumentsParameter { … … 133 133 134 134 [StorableConstructor] 135 protected SymbolicClassificationProblem(bool deserializing) : base(deserializing) { } 135 private SymbolicClassificationProblem(bool deserializing) : base(deserializing) { } 136 private SymbolicClassificationProblem(SymbolicClassificationProblem original, Cloner cloner) 137 : base(original, cloner) { 138 RegisterParameterEvents(); 139 140 UpdateEstimationLimits(); 141 ParameterizeEvaluator(); 142 ParameterizeSolutionCreator(); 143 ParameterizeGrammar(); 144 ParameterizeOperators(); 145 ParameterizeAnalyzers(); 146 } 136 147 public SymbolicClassificationProblem() 137 148 : base() { … … 167 178 } 168 179 169 170 [StorableHook(HookType.AfterDeserialization)] 171 private void AfterDeserialization() { 172 180 public override IDeepCloneable Clone(Cloner cloner) { 181 return new SymbolicClassificationProblem(this, cloner); 173 182 } 174 183 … … 213 222 OnGrammarChanged(); 214 223 } 215 pr otected virtualvoid OnGrammarChanged() {224 private void OnGrammarChanged() { 216 225 ParameterizeGrammar(); 217 226 } … … 225 234 OnArchitectureParameterChanged(); 226 235 } 227 pr otected virtualvoid OnArchitectureParameterChanged() {228 ParameterizeGrammar(); 229 } 230 231 pr otected virtualvoid InitializeOperators() {236 private void OnArchitectureParameterChanged() { 237 ParameterizeGrammar(); 238 } 239 240 private void InitializeOperators() { 232 241 Operators.AddRange(ApplicationManager.Manager.GetInstances<ISymbolicExpressionTreeOperator>().OfType<IOperator>()); 233 242 Operators.Add(new MinAverageMaxSymbolicExpressionTreeSizeAnalyzer()); -
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.