Changeset 14294 for trunk/sources/HeuristicLab.Problems.DataAnalysis
- Timestamp:
- 09/20/16 17:14:41 (8 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/ClassificationPerformanceMeasuresCalculator.cs
r14293 r14294 33 33 } 34 34 35 // private constructor used internally by the Clone() method 36 private ClassificationPerformanceMeasuresCalculator(ClassificationPerformanceMeasuresCalculator other) { 37 // copy everything including the errorState 38 positiveClassName = other.positiveClassName; 39 positiveClassValue = other.positiveClassValue; 40 truePositiveCount = other.truePositiveCount; 41 falsePositiveCount = other.falsePositiveCount; 42 trueNegativeCount = other.trueNegativeCount; 43 falseNegativeCount = other.falseNegativeCount; 44 errorState = other.errorState; 35 protected ClassificationPerformanceMeasuresCalculator(ClassificationPerformanceMeasuresCalculator original, Cloner cloner = null) { 36 positiveClassName = original.positiveClassName; 37 positiveClassValue = original.positiveClassValue; 38 truePositiveCount = original.truePositiveCount; 39 falsePositiveCount = original.falsePositiveCount; 40 trueNegativeCount = original.trueNegativeCount; 41 falseNegativeCount = original.falseNegativeCount; 42 errorState = original.errorState; 45 43 } 46 44 … … 158 156 var clone = cloner.GetClone(this); 159 157 if (clone == null) { 160 clone = (IDeepCloneable)this.Clone();158 clone = new ClassificationPerformanceMeasuresCalculator(this); 161 159 cloner.RegisterClonedObject(this, clone); 162 160 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineAccuracyCalculator.cs
r14293 r14294 40 40 41 41 // private constructor used internally by the Clone() method 42 pr ivate OnlineAccuracyCalculator(OnlineAccuracyCalculator other) {42 protected OnlineAccuracyCalculator(OnlineAccuracyCalculator other, Cloner cloner = null) { 43 43 correctlyClassified = other.correctlyClassified; 44 44 n = other.n; … … 106 106 var clone = cloner.GetClone(this); 107 107 if (clone == null) { 108 clone = (IDeepCloneable)this.Clone();108 clone = new OnlineAccuracyCalculator(this); 109 109 cloner.RegisterClonedObject(this, clone); 110 110 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineBoundedMeanSquaredErrorCalculator.cs
r14293 r14294 45 45 } 46 46 47 // private constructor used internally by the Clone() method 48 private OnlineBoundedMeanSquaredErrorCalculator(OnlineBoundedMeanSquaredErrorCalculator other) { 49 LowerBound = other.LowerBound; 50 UpperBound = other.UpperBound; 51 n = other.n; 52 errorSum = other.errorSum; 53 errorState = other.ErrorState; 47 protected OnlineBoundedMeanSquaredErrorCalculator(OnlineBoundedMeanSquaredErrorCalculator original, Cloner cloner = null) { 48 LowerBound = original.LowerBound; 49 UpperBound = original.UpperBound; 50 n = original.n; 51 errorSum = original.errorSum; 52 errorState = original.ErrorState; 54 53 } 55 54 … … 115 114 var clone = cloner.GetClone(this); 116 115 if (clone == null) { 117 clone = (IDeepCloneable)this.Clone();116 clone = new OnlineBoundedMeanSquaredErrorCalculator(this); 118 117 cloner.RegisterClonedObject(this, clone); 119 118 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineCovarianceCalculator.cs
r14293 r14294 39 39 } 40 40 41 // private constructor used internally by the Clone() method 42 private OnlineCovarianceCalculator(OnlineCovarianceCalculator other) : this() { 41 protected OnlineCovarianceCalculator(OnlineCovarianceCalculator other, Cloner cloner = null) { 43 42 Cn = other.Cn; 44 43 xMean = other.xMean; … … 113 112 var clone = cloner.GetClone(this); 114 113 if (clone == null) { 115 clone = (IDeepCloneable)this.Clone();114 clone = new OnlineCovarianceCalculator(this); 116 115 cloner.RegisterClonedObject(this, clone); 117 116 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineDirectionalSymmetryCalculator.cs
r14293 r14294 41 41 } 42 42 43 // private constructor used internally by the Clone() method 44 private OnlineDirectionalSymmetryCalculator(OnlineDirectionalSymmetryCalculator other) { 43 protected OnlineDirectionalSymmetryCalculator(OnlineDirectionalSymmetryCalculator other, Cloner cloner = null) { 45 44 n = other.n; 46 45 nCorrect = other.nCorrect; … … 132 131 var clone = cloner.GetClone(this); 133 132 if (clone == null) { 134 clone = (IDeepCloneable)this.Clone();133 clone = new OnlineDirectionalSymmetryCalculator(this); 135 134 cloner.RegisterClonedObject(this, clone); 136 135 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineLinearScalingParameterCalculator.cs
r14293 r14294 66 66 } 67 67 68 // private constructor used internally by the Clone() method 69 private OnlineLinearScalingParameterCalculator(OnlineMeanAndVarianceCalculator targetMeanCalculator, OnlineMeanAndVarianceCalculator originalMeanAndVarianceCalculator, OnlineCovarianceCalculator originalTargetCovarianceCalculator) { 70 this.targetMeanCalculator = targetMeanCalculator; 71 this.originalMeanAndVarianceCalculator = originalMeanAndVarianceCalculator; 72 this.originalTargetCovarianceCalculator = originalTargetCovarianceCalculator; 68 protected OnlineLinearScalingParameterCalculator(OnlineLinearScalingParameterCalculator other, Cloner cloner) { 69 targetMeanCalculator = (OnlineMeanAndVarianceCalculator)other.targetMeanCalculator.Clone(cloner); 70 originalMeanAndVarianceCalculator = (OnlineMeanAndVarianceCalculator)other.originalMeanAndVarianceCalculator.Clone(cloner); 71 originalTargetCovarianceCalculator = (OnlineCovarianceCalculator)other.originalTargetCovarianceCalculator.Clone(cloner); 73 72 // do not reset the calculators here 74 73 } … … 129 128 // IDeepCloneable interface members 130 129 public object Clone() { 131 var targetMeanCalculatorClone = (OnlineMeanAndVarianceCalculator)targetMeanCalculator.Clone(); 132 var originalMeanAndVarianceCalculatorClone = (OnlineMeanAndVarianceCalculator)originalMeanAndVarianceCalculator.Clone(); 133 var originalTargetCovarianceCalculatorClone = (OnlineCovarianceCalculator)originalTargetCovarianceCalculator.Clone(); 134 return new OnlineLinearScalingParameterCalculator(targetMeanCalculatorClone, originalMeanAndVarianceCalculatorClone, originalTargetCovarianceCalculatorClone); 130 var cloner = new Cloner(); 131 return new OnlineLinearScalingParameterCalculator(this, cloner); 135 132 } 136 133 … … 138 135 var clone = cloner.GetClone(this); 139 136 if (clone == null) { 140 var targetMeanCalculatorClone = (OnlineMeanAndVarianceCalculator)targetMeanCalculator.Clone(cloner); 141 var originalMeanAndVarianceCalculatorClone = (OnlineMeanAndVarianceCalculator)originalMeanAndVarianceCalculator.Clone(cloner); 142 var originalTargetCovarianceCalculatorClone = (OnlineCovarianceCalculator)originalTargetCovarianceCalculator.Clone(cloner); 143 clone = new OnlineLinearScalingParameterCalculator(targetMeanCalculatorClone, originalMeanAndVarianceCalculatorClone, originalTargetCovarianceCalculatorClone); 137 clone = new OnlineLinearScalingParameterCalculator(this, cloner); 144 138 cloner.RegisterClonedObject(this, clone); 145 139 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineMaxAbsoluteErrorCalculator.cs
r14293 r14294 39 39 } 40 40 41 // private constructor used internally by the Clone() method 42 private OnlineMaxAbsoluteErrorCalculator(OnlineMaxAbsoluteErrorCalculator other) { 41 protected OnlineMaxAbsoluteErrorCalculator(OnlineMaxAbsoluteErrorCalculator other, Cloner cloner = null) { 43 42 mae = other.mae; 44 43 n = other.n; … … 105 104 var clone = cloner.GetClone(this); 106 105 if (clone == null) { 107 clone = (IDeepCloneable)this.Clone();106 clone = new OnlineMaxAbsoluteErrorCalculator(this); 108 107 cloner.RegisterClonedObject(this, clone); 109 108 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineMeanAbsoluteErrorCalculator.cs
r14293 r14294 39 39 } 40 40 41 pr ivate OnlineMeanAbsoluteErrorCalculator(OnlineMeanAbsoluteErrorCalculator other) {41 protected OnlineMeanAbsoluteErrorCalculator(OnlineMeanAbsoluteErrorCalculator other, Cloner cloner = null) { 42 42 sae = other.sae; 43 43 n = other.n; … … 103 103 var clone = cloner.GetClone(this); 104 104 if (clone == null) { 105 clone = (IDeepCloneable)this.Clone();105 clone = new OnlineMeanAbsoluteErrorCalculator(this); 106 106 cloner.RegisterClonedObject(this, clone); 107 107 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineMeanAbsolutePercentageErrorCalculator.cs
r14293 r14294 39 39 } 40 40 41 // private constructor used internally by the Clone() method 42 private OnlineMeanAbsolutePercentageErrorCalculator(OnlineMeanAbsolutePercentageErrorCalculator other) { 41 protected OnlineMeanAbsolutePercentageErrorCalculator(OnlineMeanAbsolutePercentageErrorCalculator other, Cloner cloner = null) { 43 42 sre = other.sre; 44 43 n = other.n; … … 105 104 var clone = cloner.GetClone(this); 106 105 if (clone == null) { 107 clone = (IDeepCloneable)this.Clone();106 clone = new OnlineMeanAbsolutePercentageErrorCalculator(this); 108 107 cloner.RegisterClonedObject(this, clone); 109 108 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineMeanAndVarianceCalculator.cs
r14293 r14294 67 67 } 68 68 69 pr ivate OnlineMeanAndVarianceCalculator(OnlineMeanAndVarianceCalculator other) : this() {69 protected OnlineMeanAndVarianceCalculator(OnlineMeanAndVarianceCalculator other, Cloner cloner = null) { 70 70 m_oldS = other.m_oldS; 71 71 m_oldM = other.m_oldM; … … 126 126 var clone = cloner.GetClone(this); 127 127 if (clone == null) { 128 clone = (IDeepCloneable)this.Clone();128 clone = new OnlineMeanAndVarianceCalculator(this); 129 129 cloner.RegisterClonedObject(this, clone); 130 130 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineMeanErrorCalculator.cs
r14293 r14294 37 37 } 38 38 39 pr ivate OnlineMeanErrorCalculator(OnlineMeanAndVarianceCalculator meanAndVarianceCalculator) {40 this.meanAndVarianceCalculator = meanAndVarianceCalculator;39 protected OnlineMeanErrorCalculator(OnlineMeanErrorCalculator other, Cloner cloner) { 40 meanAndVarianceCalculator = (OnlineMeanAndVarianceCalculator)other.meanAndVarianceCalculator.Clone(cloner); 41 41 } 42 42 … … 82 82 // IDeepCloneable members 83 83 public object Clone() { 84 var meanAndVarianceCalculatorClone = (OnlineMeanAndVarianceCalculator)meanAndVarianceCalculator.Clone();85 return new OnlineMeanErrorCalculator( meanAndVarianceCalculatorClone);84 var cloner = new Cloner(); 85 return new OnlineMeanErrorCalculator(this, cloner); 86 86 } 87 87 … … 89 89 var clone = cloner.GetClone(this); 90 90 if (clone == null) { 91 var meanAndVarianceCalculatorClone = (OnlineMeanAndVarianceCalculator)meanAndVarianceCalculator.Clone(cloner); 92 clone = new OnlineMeanErrorCalculator(meanAndVarianceCalculatorClone); 91 clone = new OnlineMeanErrorCalculator(this, cloner); 93 92 cloner.RegisterClonedObject(this, clone); 94 93 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineMeanSquaredErrorCalculator.cs
r14293 r14294 39 39 } 40 40 41 // private constructor used internally by the Clone() method 42 private OnlineMeanSquaredErrorCalculator(OnlineMeanSquaredErrorCalculator other) { 41 protected OnlineMeanSquaredErrorCalculator(OnlineMeanSquaredErrorCalculator other, Cloner cloner = null) { 43 42 sse = other.sse; 44 43 n = other.n; … … 104 103 var clone = cloner.GetClone(this); 105 104 if (clone == null) { 106 clone = (IDeepCloneable)this.Clone();105 clone = new OnlineMeanSquaredErrorCalculator(this); 107 106 cloner.RegisterClonedObject(this, clone); 108 107 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineNormalizedMeanSquaredErrorCalculator.cs
r14293 r14294 43 43 } 44 44 45 // private constructor used internally by the Clone() method 46 public OnlineNormalizedMeanSquaredErrorCalculator(OnlineMeanAndVarianceCalculator meanSquaredErrorCalculator, OnlineMeanAndVarianceCalculator originalVarianceCalculator) { 47 this.meanSquaredErrorCalculator = meanSquaredErrorCalculator; 48 this.originalVarianceCalculator = originalVarianceCalculator; 45 protected OnlineNormalizedMeanSquaredErrorCalculator(OnlineNormalizedMeanSquaredErrorCalculator other, Cloner cloner) { 46 meanSquaredErrorCalculator = (OnlineMeanAndVarianceCalculator)other.meanSquaredErrorCalculator.Clone(cloner); 47 originalVarianceCalculator = (OnlineMeanAndVarianceCalculator)originalVarianceCalculator.Clone(cloner); 49 48 } 50 49 … … 102 101 // IDeepCloneable members 103 102 public object Clone() { 104 var meanSquaredErrorCalculatorClone = (OnlineMeanAndVarianceCalculator)meanSquaredErrorCalculator.Clone(); 105 var originalVarianceCalculatorClone = (OnlineMeanAndVarianceCalculator)originalVarianceCalculator.Clone(); 106 return new OnlineNormalizedMeanSquaredErrorCalculator(meanSquaredErrorCalculatorClone, originalVarianceCalculatorClone); 103 var cloner = new Cloner(); 104 return new OnlineNormalizedMeanSquaredErrorCalculator(this, cloner); 107 105 } 108 106 … … 110 108 var clone = cloner.GetClone(this); 111 109 if (clone == null) { 112 var meanSquaredErrorCalculatorClone = (OnlineMeanAndVarianceCalculator)meanSquaredErrorCalculator.Clone(cloner); 113 var originalVarianceCalculatorClone = (OnlineMeanAndVarianceCalculator)originalVarianceCalculator.Clone(cloner); 114 clone = new OnlineNormalizedMeanSquaredErrorCalculator(meanSquaredErrorCalculatorClone, originalVarianceCalculatorClone); 110 clone = new OnlineNormalizedMeanSquaredErrorCalculator(this, cloner); 115 111 cloner.RegisterClonedObject(this, clone); 116 112 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlinePearsonsRCalculator.cs
r14293 r14294 47 47 public OnlinePearsonsRCalculator() { } 48 48 49 // private constructor used internally by the Clone() method 50 private OnlinePearsonsRCalculator(OnlineCovarianceCalculator covCalculator, OnlineMeanAndVarianceCalculator sxCalculator, OnlineMeanAndVarianceCalculator syCalculator) { 51 this.covCalculator = covCalculator; 52 this.sxCalculator = sxCalculator; 53 this.syCalculator = syCalculator; 49 protected OnlinePearsonsRCalculator(OnlinePearsonsRCalculator other, Cloner cloner) { 50 covCalculator = (OnlineCovarianceCalculator)other.covCalculator.Clone(cloner); 51 sxCalculator = (OnlineMeanAndVarianceCalculator)other.sxCalculator.Clone(cloner); 52 syCalculator = (OnlineMeanAndVarianceCalculator)other.syCalculator.Clone(cloner); 54 53 } 55 54 … … 101 100 // IDeepCloneable members 102 101 public object Clone() { 103 var covCalculatorClone = (OnlineCovarianceCalculator)covCalculator.Clone(); 104 var sxCalculatorClone = (OnlineMeanAndVarianceCalculator)sxCalculator.Clone(); 105 var syCalculatorClone = (OnlineMeanAndVarianceCalculator)syCalculator.Clone(); 106 return new OnlinePearsonsRCalculator(covCalculatorClone, sxCalculatorClone, syCalculatorClone); 102 var cloner = new Cloner(); 103 return new OnlinePearsonsRCalculator(this, cloner); 107 104 } 108 105 … … 110 107 var clone = cloner.GetClone(this); 111 108 if (clone == null) { 112 var covCalculatorClone = (OnlineCovarianceCalculator)covCalculator.Clone(cloner); 113 var sxCalculatorClone = (OnlineMeanAndVarianceCalculator)sxCalculator.Clone(cloner); 114 var syCalculatorClone = (OnlineMeanAndVarianceCalculator)syCalculator.Clone(cloner); 115 clone = new OnlinePearsonsRCalculator(covCalculatorClone, sxCalculatorClone, syCalculatorClone); 109 clone = new OnlinePearsonsRCalculator(this, cloner); 116 110 cloner.RegisterClonedObject(this, clone); 117 111 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlinePearsonsRSquaredCalculator.cs
r14293 r14294 38 38 public OnlinePearsonsRSquaredCalculator() { } 39 39 40 pr ivate OnlinePearsonsRSquaredCalculator(OnlinePearsonsRCalculator rCalculator) {41 this.rCalculator = rCalculator;40 protected OnlinePearsonsRSquaredCalculator(OnlinePearsonsRSquaredCalculator other, Cloner cloner) { 41 this.rCalculator = (OnlinePearsonsRCalculator)other.rCalculator.Clone(cloner); 42 42 } 43 43 … … 66 66 // IDeepCloneable members 67 67 public object Clone() { 68 var rCalculatorClone = (OnlinePearsonsRCalculator)rCalculator.Clone();69 return new OnlinePearsonsRSquaredCalculator( rCalculatorClone);68 var cloner = new Cloner(); 69 return new OnlinePearsonsRSquaredCalculator(this, cloner); 70 70 } 71 71 … … 73 73 var clone = cloner.GetClone(this); 74 74 if (clone == null) { 75 var rCalculatorClone = (OnlinePearsonsRCalculator)rCalculator.Clone(cloner); 76 clone = new OnlinePearsonsRSquaredCalculator(rCalculatorClone); 75 clone = new OnlinePearsonsRSquaredCalculator(this, cloner); 77 76 cloner.RegisterClonedObject(this, clone); 78 77 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineTheilsUStatisticCalculator.cs
r14293 r14294 46 46 } 47 47 48 // private constructor used internally by the Clone() method 49 private OnlineTheilsUStatisticCalculator(OnlineMeanAndVarianceCalculator squaredErrorMeanCalculator, OnlineMeanAndVarianceCalculator unbiasedEstimatorMeanCalculator) { 50 this.squaredErrorMeanCalculator = squaredErrorMeanCalculator; 51 this.unbiasedEstimatorMeanCalculator = unbiasedEstimatorMeanCalculator; 48 protected OnlineTheilsUStatisticCalculator(OnlineTheilsUStatisticCalculator other, Cloner cloner) { 49 squaredErrorMeanCalculator = (OnlineMeanAndVarianceCalculator)other.squaredErrorMeanCalculator.Clone(cloner); 50 unbiasedEstimatorMeanCalculator = (OnlineMeanAndVarianceCalculator)other.unbiasedEstimatorMeanCalculator.Clone(cloner); 52 51 } 53 52 … … 135 134 // IDeepCloneable members 136 135 public object Clone() { 137 var squaredErrorMeanCalculatorClone = (OnlineMeanAndVarianceCalculator)squaredErrorMeanCalculator.Clone(); 138 var unbiasedEstimatorMeanCalculatorClone = (OnlineMeanAndVarianceCalculator)unbiasedEstimatorMeanCalculator.Clone(); 139 return new OnlineTheilsUStatisticCalculator(squaredErrorMeanCalculatorClone, unbiasedEstimatorMeanCalculatorClone); 136 var cloner = new Cloner(); 137 return new OnlineTheilsUStatisticCalculator(this, cloner); 140 138 } 141 139 … … 143 141 var clone = cloner.GetClone(this); 144 142 if (clone == null) { 145 var squaredErrorMeanCalculatorClone = (OnlineMeanAndVarianceCalculator)squaredErrorMeanCalculator.Clone(cloner); 146 var unbiasedEstimatorMeanCalculatorClone = (OnlineMeanAndVarianceCalculator)unbiasedEstimatorMeanCalculator.Clone(cloner); 147 clone = new OnlineTheilsUStatisticCalculator(squaredErrorMeanCalculatorClone, unbiasedEstimatorMeanCalculatorClone); 143 clone = new OnlineTheilsUStatisticCalculator(this, cloner); 148 144 cloner.RegisterClonedObject(this, clone); 149 145 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineWeightedDirectionalSymmetryCalculator.cs
r14293 r14294 42 42 } 43 43 44 // private constructor used internally by the Clone() method 45 private OnlineWeightedDirectionalSymmetryCalculator(OnlineWeightedDirectionalSymmetryCalculator other) { 44 protected OnlineWeightedDirectionalSymmetryCalculator(OnlineWeightedDirectionalSymmetryCalculator other, Cloner cloner = null) { 46 45 n = other.n; 47 46 correctSum = other.correctSum; … … 135 134 var clone = cloner.GetClone(this); 136 135 if (clone == null) { 137 clone = (IDeepCloneable)this.Clone();136 clone = new OnlineWeightedDirectionalSymmetryCalculator(this); 138 137 cloner.RegisterClonedObject(this, clone); 139 138 }
Note: See TracChangeset
for help on using the changeset viewer.