Changeset 5579 for branches/DataAnalysis Refactoring
- Timestamp:
- 03/01/11 14:42:45 (14 years ago)
- Location:
- branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/ClassificationProblem.cs
r5577 r5579 20 20 #endregion 21 21 22 using System;23 22 using HeuristicLab.Common; 24 23 using HeuristicLab.Core; 25 using HeuristicLab.Parameters;26 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 25 … … 30 28 [Item("ClassificationProblem", "")] 31 29 [Creatable] 32 public class ClassificationProblem : DataAnalysisProblem<IClassificationProblemData>, 33 IClassificationProblem { 34 private const string ProblemDataParameterName = "ProblemData"; 35 public ClassificationProblem(ClassificationProblem original, Cloner cloner) 36 : base(original, cloner) { 37 RegisterEventHandlers(); 38 } 30 public class ClassificationProblem : DataAnalysisProblem<IClassificationProblemData>, IClassificationProblem { 39 31 [StorableConstructor] 40 32 public ClassificationProblem(bool deserializing) : base(deserializing) { } 33 public ClassificationProblem(ClassificationProblem original, Cloner cloner) : base(original, cloner) { } 34 public override IDeepCloneable Clone(Cloner cloner) { return new ClassificationProblem(this, cloner); } 35 41 36 public ClassificationProblem() 42 37 : base() { 43 Parameters.Add(new ValueParameter<IClassificationProblemData>(ProblemDataParameterName, "", new ClassificationProblemData())); 44 RegisterEventHandlers(); 38 ProblemData = new ClassificationProblemData(); 45 39 } 46 47 [StorableHook(HookType.AfterDeserialization)]48 private void AfterDeserialization() {49 RegisterEventHandlers();50 }51 52 public override IDeepCloneable Clone(Cloner cloner) {53 return new ClassificationProblem(this, cloner);54 }55 56 private void RegisterEventHandlers() {57 ProblemDataParameter.Value.Changed += new EventHandler(Value_Changed);58 }59 60 #region event propagation61 private void Value_Changed(object sender, EventArgs e) {62 //OnReset();63 }64 #endregion65 40 } 66 41 } -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/ClassificationProblemData.cs
r5559 r5579 288 288 public void SetClassificationPenalty(double correctClassValue, double estimatedClassValue, double penalty) { 289 289 var key = Tuple.Create(correctClassValue, estimatedClassValue); 290 if ( misclassificationMatrix[key] != penalty) {290 if (!misclassificationMatrix.ContainsKey(key) || misclassificationMatrix[key] != penalty) { 291 291 misclassificationMatrix[key] = penalty; 292 292 OnClassificationPenaltyChanged(); -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/RegressionProblem.cs
r5577 r5579 28 28 [Item("RegressionProblem", "")] 29 29 [Creatable] 30 public class RegressionProblem : DataAnalysisProblem<IRegressionProblemData>, 31 IRegressionProblem { 32 public RegressionProblem(RegressionProblem original, Cloner cloner) 33 : base(original, cloner) { 34 } 30 public class RegressionProblem : DataAnalysisProblem<IRegressionProblemData>, IRegressionProblem { 35 31 [StorableConstructor] 36 32 public RegressionProblem(bool deserializing) : base(deserializing) { } 33 public RegressionProblem(RegressionProblem original, Cloner cloner) : base(original, cloner) { } 34 public override IDeepCloneable Clone(Cloner cloner) { return new RegressionProblem(this, cloner); } 35 37 36 public RegressionProblem() 38 37 : base() { 39 } 40 41 [StorableHook(HookType.AfterDeserialization)] 42 private void AfterDeserialization() { 43 } 44 45 public override IDeepCloneable Clone(Cloner cloner) { 46 return new RegressionProblem(this, cloner); 38 ProblemData = new RegressionProblemData(); 47 39 } 48 40 }
Note: See TracChangeset
for help on using the changeset viewer.