- Timestamp:
- 03/30/17 16:57:38 (8 years ago)
- Location:
- stable
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 14293-14295,14372,14376,14465
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.DataAnalysis merged: 14293-14295,14372,14376,14465
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/ClassificationPerformanceMeasuresCalculator.cs
r14186 r14801 23 23 using System.Collections.Generic; 24 24 using HeuristicLab.Common; 25 using HeuristicLab.Problems.DataAnalysis.OnlineCalculators;26 25 27 26 namespace HeuristicLab.Problems.DataAnalysis { 28 public class ClassificationPerformanceMeasuresCalculator {27 public class ClassificationPerformanceMeasuresCalculator : DeepCloneable { 29 28 30 29 public ClassificationPerformanceMeasuresCalculator(string positiveClassName, double positiveClassValue) { … … 32 31 this.positiveClassValue = positiveClassValue; 33 32 Reset(); 33 } 34 35 protected ClassificationPerformanceMeasuresCalculator(ClassificationPerformanceMeasuresCalculator original, Cloner cloner) 36 : base(original, cloner) { 37 positiveClassName = original.positiveClassName; 38 positiveClassValue = original.positiveClassValue; 39 truePositiveCount = original.truePositiveCount; 40 falsePositiveCount = original.falsePositiveCount; 41 trueNegativeCount = original.trueNegativeCount; 42 falseNegativeCount = original.falseNegativeCount; 43 errorState = original.errorState; 44 } 45 public override IDeepCloneable Clone(Cloner cloner) { 46 return new ClassificationPerformanceMeasuresCalculator(this, cloner); 34 47 } 35 48 -
stable/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineAccuracyCalculator.cs
r14186 r14801 25 25 26 26 namespace HeuristicLab.Problems.DataAnalysis { 27 public class OnlineAccuracyCalculator : IOnlineCalculator {27 public class OnlineAccuracyCalculator : DeepCloneable, IOnlineCalculator { 28 28 29 29 private int correctlyClassified; … … 38 38 Reset(); 39 39 } 40 41 protected OnlineAccuracyCalculator(OnlineAccuracyCalculator original, Cloner cloner) 42 : base(original, cloner) { 43 correctlyClassified = original.correctlyClassified; 44 n = original.n; 45 errorState = original.errorState; 46 } 47 48 public override IDeepCloneable Clone(Cloner cloner) { 49 return new OnlineAccuracyCalculator(this, cloner); 50 } 51 40 52 41 53 #region IOnlineCalculator Members … … 90 102 } 91 103 } 104 92 105 } 93 106 } -
stable/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineBoundedMeanSquaredErrorCalculator.cs
r14186 r14801 22 22 using System; 23 23 using System.Collections.Generic; 24 using HeuristicLab.Common; 24 25 25 26 namespace HeuristicLab.Problems.DataAnalysis { 26 public class OnlineBoundedMeanSquaredErrorCalculator : IOnlineCalculator {27 public class OnlineBoundedMeanSquaredErrorCalculator : DeepCloneable, IOnlineCalculator { 27 28 28 29 private double errorSum; … … 38 39 39 40 40 public OnlineBoundedMeanSquaredErrorCalculator(double lowerBound, double upper bound) {41 public OnlineBoundedMeanSquaredErrorCalculator(double lowerBound, double upperBound) { 41 42 LowerBound = lowerBound; 42 UpperBound = upper bound;43 UpperBound = upperBound; 43 44 Reset(); 45 } 46 47 protected OnlineBoundedMeanSquaredErrorCalculator(OnlineBoundedMeanSquaredErrorCalculator original, Cloner cloner) 48 : base(original, cloner) { 49 LowerBound = original.LowerBound; 50 UpperBound = original.UpperBound; 51 n = original.n; 52 errorSum = original.errorSum; 53 errorState = original.ErrorState; 54 } 55 public override IDeepCloneable Clone(Cloner cloner) { 56 return new OnlineBoundedMeanSquaredErrorCalculator(this, cloner); 44 57 } 45 58 -
stable/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineCovarianceCalculator.cs
r14186 r14801 22 22 using System; 23 23 using System.Collections.Generic; 24 using HeuristicLab.Common; 24 25 25 26 namespace HeuristicLab.Problems.DataAnalysis { 26 public class OnlineCovarianceCalculator : IOnlineCalculator {27 public class OnlineCovarianceCalculator : DeepCloneable, IOnlineCalculator { 27 28 28 29 private double xMean, yMean, Cn; … … 36 37 public OnlineCovarianceCalculator() { 37 38 Reset(); 39 } 40 41 protected OnlineCovarianceCalculator(OnlineCovarianceCalculator original, Cloner cloner) 42 : base(original, cloner) { 43 Cn = original.Cn; 44 xMean = original.xMean; 45 yMean = original.yMean; 46 n = original.n; 47 errorState = original.errorState; 48 } 49 50 public override IDeepCloneable Clone(Cloner cloner) { 51 return new OnlineCovarianceCalculator(this, cloner); 38 52 } 39 53 -
stable/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineDirectionalSymmetryCalculator.cs
r14186 r14801 26 26 27 27 namespace HeuristicLab.Problems.DataAnalysis { 28 public class OnlineDirectionalSymmetryCalculator : IOnlineTimeSeriesCalculator {28 public class OnlineDirectionalSymmetryCalculator : DeepCloneable, IOnlineTimeSeriesCalculator { 29 29 private int n; 30 30 private int nCorrect; … … 39 39 public OnlineDirectionalSymmetryCalculator() { 40 40 Reset(); 41 } 42 43 protected OnlineDirectionalSymmetryCalculator(OnlineDirectionalSymmetryCalculator original, Cloner cloner = null) 44 : base(original, cloner) { 45 n = original.n; 46 nCorrect = original.nCorrect; 47 errorState = original.errorState; 48 } 49 50 public override IDeepCloneable Clone(Cloner cloner) { 51 return new OnlineDirectionalSymmetryCalculator(this, cloner); 41 52 } 42 53 … … 94 105 return dsCalculator.DirectionalSymmetry; 95 106 } 96 107 97 108 public static double Calculate(IEnumerable<double> startValues, IEnumerable<IEnumerable<double>> actualContinuations, IEnumerable<IEnumerable<double>> predictedContinuations, out OnlineCalculatorError errorState) { 98 109 IEnumerator<double> startValueEnumerator = startValues.GetEnumerator(); -
stable/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineLinearScalingParameterCalculator.cs
r14186 r14801 25 25 26 26 namespace HeuristicLab.Problems.DataAnalysis { 27 public class OnlineLinearScalingParameterCalculator {27 public class OnlineLinearScalingParameterCalculator : DeepCloneable { 28 28 29 29 /// <summary> … … 55 55 } 56 56 57 private OnlineMeanAndVarianceCalculator targetMeanCalculator;58 private OnlineMeanAndVarianceCalculator originalMeanAndVarianceCalculator;59 private OnlineCovarianceCalculator originalTargetCovarianceCalculator;57 private readonly OnlineMeanAndVarianceCalculator targetMeanCalculator; 58 private readonly OnlineMeanAndVarianceCalculator originalMeanAndVarianceCalculator; 59 private readonly OnlineCovarianceCalculator originalTargetCovarianceCalculator; 60 60 61 61 public OnlineLinearScalingParameterCalculator() { … … 65 65 Reset(); 66 66 } 67 68 protected OnlineLinearScalingParameterCalculator(OnlineLinearScalingParameterCalculator original, Cloner cloner) 69 : base(original, cloner) { 70 targetMeanCalculator = cloner.Clone(original.targetMeanCalculator); 71 originalMeanAndVarianceCalculator = cloner.Clone(original.originalMeanAndVarianceCalculator); 72 originalTargetCovarianceCalculator = cloner.Clone(original.originalTargetCovarianceCalculator); 73 // do not reset the calculators here 74 } 75 public override IDeepCloneable Clone(Cloner cloner) { 76 return new OnlineLinearScalingParameterCalculator(this, cloner); 77 } 78 67 79 68 80 public void Reset() { -
stable/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineMaxAbsoluteErrorCalculator.cs
r14186 r14801 22 22 using System; 23 23 using System.Collections.Generic; 24 using HeuristicLab.Common; 24 25 25 26 namespace HeuristicLab.Problems.DataAnalysis { 26 public class OnlineMaxAbsoluteErrorCalculator : IOnlineCalculator {27 public class OnlineMaxAbsoluteErrorCalculator : DeepCloneable, IOnlineCalculator { 27 28 28 29 private double mae; … … 36 37 public OnlineMaxAbsoluteErrorCalculator() { 37 38 Reset(); 39 } 40 41 protected OnlineMaxAbsoluteErrorCalculator(OnlineMaxAbsoluteErrorCalculator original, Cloner cloner = null) 42 : base(original, cloner) { 43 mae = original.mae; 44 n = original.n; 45 errorState = original.errorState; 46 } 47 public override IDeepCloneable Clone(Cloner cloner) { 48 return new OnlineMaxAbsoluteErrorCalculator(this, cloner); 38 49 } 39 50 -
stable/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineMeanAbsoluteErrorCalculator.cs
r14186 r14801 22 22 using System; 23 23 using System.Collections.Generic; 24 using HeuristicLab.Common; 24 25 25 26 namespace HeuristicLab.Problems.DataAnalysis { 26 public class OnlineMeanAbsoluteErrorCalculator : IOnlineCalculator {27 public class OnlineMeanAbsoluteErrorCalculator : DeepCloneable, IOnlineCalculator { 27 28 28 29 private double sae; … … 36 37 public OnlineMeanAbsoluteErrorCalculator() { 37 38 Reset(); 39 } 40 41 protected OnlineMeanAbsoluteErrorCalculator(OnlineMeanAbsoluteErrorCalculator original, Cloner cloner = null) 42 : base(original, cloner) { 43 sae = original.sae; 44 n = original.n; 45 errorState = original.errorState; 46 } 47 public override IDeepCloneable Clone(Cloner cloner) { 48 return new OnlineMeanAbsoluteErrorCalculator(this, cloner); 38 49 } 39 50 -
stable/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineMeanAbsolutePercentageErrorCalculator.cs
r14186 r14801 25 25 26 26 namespace HeuristicLab.Problems.DataAnalysis { 27 public class OnlineMeanAbsolutePercentageErrorCalculator : IOnlineCalculator {27 public class OnlineMeanAbsolutePercentageErrorCalculator : DeepCloneable, IOnlineCalculator { 28 28 29 29 private double sre; … … 37 37 public OnlineMeanAbsolutePercentageErrorCalculator() { 38 38 Reset(); 39 } 40 41 protected OnlineMeanAbsolutePercentageErrorCalculator(OnlineMeanAbsolutePercentageErrorCalculator original, Cloner cloner = null) 42 : base(original, cloner) { 43 sre = original.sre; 44 n = original.n; 45 errorState = original.errorState; 46 } 47 48 public override IDeepCloneable Clone(Cloner cloner) { 49 return new OnlineMeanAbsolutePercentageErrorCalculator(this, cloner); 39 50 } 40 51 -
stable/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineMeanAndVarianceCalculator.cs
r14303 r14801 21 21 22 22 using System.Collections.Generic; 23 using HeuristicLab.Common; 23 24 24 25 namespace HeuristicLab.Problems.DataAnalysis { 25 public class OnlineMeanAndVarianceCalculator {26 public class OnlineMeanAndVarianceCalculator : DeepCloneable { 26 27 27 28 private double m_oldM, m_newM, m_oldS, m_newS; … … 64 65 public OnlineMeanAndVarianceCalculator() { 65 66 Reset(); 67 } 68 69 protected OnlineMeanAndVarianceCalculator(OnlineMeanAndVarianceCalculator original, Cloner cloner = null) 70 : base(original, cloner) { 71 m_oldS = original.m_oldS; 72 m_oldM = original.m_oldM; 73 m_newS = original.m_newS; 74 m_newM = original.m_newM; 75 n = original.n; 76 errorState = original.errorState; 77 varianceErrorState = original.varianceErrorState; 78 } 79 public override IDeepCloneable Clone(Cloner cloner) { 80 return new OnlineMeanAndVarianceCalculator(this, cloner); 66 81 } 67 82 -
stable/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineMeanErrorCalculator.cs
r14186 r14801 22 22 using System; 23 23 using System.Collections.Generic; 24 using HeuristicLab.Common; 24 25 25 26 namespace HeuristicLab.Problems.DataAnalysis { 26 public class OnlineMeanErrorCalculator : IOnlineCalculator {27 public class OnlineMeanErrorCalculator : DeepCloneable, IOnlineCalculator { 27 28 28 29 private readonly OnlineMeanAndVarianceCalculator meanAndVarianceCalculator; … … 34 35 meanAndVarianceCalculator = new OnlineMeanAndVarianceCalculator(); 35 36 Reset(); 37 } 38 39 protected OnlineMeanErrorCalculator(OnlineMeanErrorCalculator original, Cloner cloner) 40 : base(original, cloner) { 41 meanAndVarianceCalculator = cloner.Clone(original.meanAndVarianceCalculator); 42 } 43 public override IDeepCloneable Clone(Cloner cloner) { 44 return new OnlineMeanErrorCalculator(this, cloner); 36 45 } 37 46 -
stable/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineMeanSquaredErrorCalculator.cs
r14186 r14801 22 22 using System; 23 23 using System.Collections.Generic; 24 using HeuristicLab.Common; 24 25 25 26 namespace HeuristicLab.Problems.DataAnalysis { 26 public class OnlineMeanSquaredErrorCalculator : IOnlineCalculator {27 public class OnlineMeanSquaredErrorCalculator : DeepCloneable, IOnlineCalculator { 27 28 28 29 private double sse; … … 36 37 public OnlineMeanSquaredErrorCalculator() { 37 38 Reset(); 39 } 40 41 protected OnlineMeanSquaredErrorCalculator(OnlineMeanSquaredErrorCalculator original, Cloner cloner) 42 : base(original, cloner) { 43 sse = original.sse; 44 n = original.n; 45 errorState = original.errorState; 46 } 47 public override IDeepCloneable Clone(Cloner cloner) { 48 return new OnlineMeanSquaredErrorCalculator(this, cloner); 38 49 } 39 50 -
stable/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineNormalizedMeanSquaredErrorCalculator.cs
r14303 r14801 22 22 using System; 23 23 using System.Collections.Generic; 24 using HeuristicLab.Common; 24 25 25 26 namespace HeuristicLab.Problems.DataAnalysis { 26 public class OnlineNormalizedMeanSquaredErrorCalculator : IOnlineCalculator {27 public class OnlineNormalizedMeanSquaredErrorCalculator : DeepCloneable, IOnlineCalculator { 27 28 private OnlineMeanAndVarianceCalculator meanSquaredErrorCalculator; 28 29 private OnlineMeanAndVarianceCalculator originalVarianceCalculator; … … 40 41 originalVarianceCalculator = new OnlineMeanAndVarianceCalculator(); 41 42 Reset(); 43 } 44 45 protected OnlineNormalizedMeanSquaredErrorCalculator(OnlineNormalizedMeanSquaredErrorCalculator original, Cloner cloner) 46 : base(original, cloner) { 47 meanSquaredErrorCalculator = cloner.Clone(original.meanSquaredErrorCalculator); 48 originalVarianceCalculator = cloner.Clone(original.originalVarianceCalculator); 49 } 50 public override IDeepCloneable Clone(Cloner cloner) { 51 return new OnlineNormalizedMeanSquaredErrorCalculator(this, cloner); 42 52 } 43 53 … … 92 102 } 93 103 } 104 105 94 106 } 95 107 } -
stable/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlinePearsonsRCalculator.cs
r14186 r14801 25 25 26 26 namespace HeuristicLab.Problems.DataAnalysis { 27 public class OnlinePearsonsRCalculator : IOnlineCalculator {27 public class OnlinePearsonsRCalculator : DeepCloneable, IOnlineCalculator { 28 28 private OnlineCovarianceCalculator covCalculator = new OnlineCovarianceCalculator(); 29 29 private OnlineMeanAndVarianceCalculator sxCalculator = new OnlineMeanAndVarianceCalculator(); … … 46 46 47 47 public OnlinePearsonsRCalculator() { } 48 49 protected OnlinePearsonsRCalculator(OnlinePearsonsRCalculator original, Cloner cloner) 50 : base(original, cloner) { 51 covCalculator = cloner.Clone(original.covCalculator); 52 sxCalculator = cloner.Clone(original.sxCalculator); 53 syCalculator = cloner.Clone(original.syCalculator); 54 } 55 public override IDeepCloneable Clone(Cloner cloner) { 56 return new OnlinePearsonsRCalculator(this, cloner); 57 } 48 58 49 59 #region IOnlineCalculator Members -
stable/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlinePearsonsRSquaredCalculator.cs
r14186 r14801 26 26 namespace HeuristicLab.Problems.DataAnalysis { 27 27 [Obsolete("Use OnlinePearsonsRCalculator directly")] 28 public class OnlinePearsonsRSquaredCalculator : IOnlineCalculator {28 public class OnlinePearsonsRSquaredCalculator : DeepCloneable, IOnlineCalculator { 29 29 private readonly OnlinePearsonsRCalculator rCalculator = new OnlinePearsonsRCalculator(); 30 30 … … 37 37 38 38 public OnlinePearsonsRSquaredCalculator() { } 39 40 protected OnlinePearsonsRSquaredCalculator(OnlinePearsonsRSquaredCalculator original, Cloner cloner) 41 : base(original, cloner) { 42 rCalculator = cloner.Clone(original.rCalculator); 43 } 44 public override IDeepCloneable Clone(Cloner cloner) { 45 return new OnlinePearsonsRSquaredCalculator(this, cloner); 46 } 39 47 40 48 #region IOnlineCalculator Members … … 59 67 return r * r; 60 68 } 69 70 61 71 } 62 72 } -
stable/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineTheilsUStatisticCalculator.cs
r14186 r14801 22 22 using System; 23 23 using System.Collections.Generic; 24 using HeuristicLab.Common; 24 25 25 26 namespace HeuristicLab.Problems.DataAnalysis { 26 public class OnlineTheilsUStatisticCalculator : IOnlineTimeSeriesCalculator {27 private OnlineMeanAndVarianceCalculator squaredErrorMeanCalculator;28 private OnlineMeanAndVarianceCalculator unbiasedEstimatorMeanCalculator;27 public class OnlineTheilsUStatisticCalculator : DeepCloneable, IOnlineTimeSeriesCalculator { 28 private readonly OnlineMeanAndVarianceCalculator squaredErrorMeanCalculator; 29 private readonly OnlineMeanAndVarianceCalculator unbiasedEstimatorMeanCalculator; 29 30 30 31 public double TheilsUStatistic { … … 43 44 unbiasedEstimatorMeanCalculator = new OnlineMeanAndVarianceCalculator(); 44 45 Reset(); 46 } 47 48 protected OnlineTheilsUStatisticCalculator(OnlineTheilsUStatisticCalculator original, Cloner cloner) 49 : base(original, cloner) { 50 squaredErrorMeanCalculator = cloner.Clone(original.squaredErrorMeanCalculator); 51 unbiasedEstimatorMeanCalculator = cloner.Clone(original.unbiasedEstimatorMeanCalculator); 52 } 53 public override IDeepCloneable Clone(Cloner cloner) { 54 return new OnlineTheilsUStatisticCalculator(this, cloner); 45 55 } 46 56 -
stable/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineWeightedDirectionalSymmetryCalculator.cs
r14186 r14801 26 26 27 27 namespace HeuristicLab.Problems.DataAnalysis { 28 public class OnlineWeightedDirectionalSymmetryCalculator : IOnlineTimeSeriesCalculator {28 public class OnlineWeightedDirectionalSymmetryCalculator : DeepCloneable, IOnlineTimeSeriesCalculator { 29 29 private int n; 30 30 private double correctSum; … … 40 40 public OnlineWeightedDirectionalSymmetryCalculator() { 41 41 Reset(); 42 } 43 44 protected OnlineWeightedDirectionalSymmetryCalculator(OnlineWeightedDirectionalSymmetryCalculator original, Cloner cloner) 45 : base(original, cloner) { 46 n = original.n; 47 correctSum = original.correctSum; 48 incorrectSum = original.incorrectSum; 49 errorState = original.errorState; 50 } 51 52 public override IDeepCloneable Clone(Cloner cloner) { 53 return new OnlineWeightedDirectionalSymmetryCalculator(this, cloner); 42 54 } 43 55
Note: See TracChangeset
for help on using the changeset viewer.