- Timestamp:
- 01/13/17 12:55:06 (8 years ago)
- Location:
- branches/MemPRAlgorithm
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/MemPRAlgorithm
-
branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.DataAnalysis (added) merged: 14422,14463,14465,14507
- Property svn:mergeinfo changed
-
branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblemData.cs
r14400 r14562 41 41 42 42 #region parameter properites 43 //mkommend: inserted parameter caching due to performance reasons 44 private IFixedValueParameter<Dataset> datasetParameter; 43 45 public IFixedValueParameter<Dataset> DatasetParameter { 44 get { return (IFixedValueParameter<Dataset>)Parameters[DatasetParameterName]; } 45 } 46 get { 47 if (datasetParameter == null) datasetParameter = (IFixedValueParameter<Dataset>)Parameters[DatasetParameterName]; 48 return datasetParameter; 49 } 50 } 51 52 private IFixedValueParameter<ReadOnlyCheckedItemList<StringValue>> inputVariablesParameter; 46 53 public IFixedValueParameter<ReadOnlyCheckedItemList<StringValue>> InputVariablesParameter { 47 get { return (IFixedValueParameter<ReadOnlyCheckedItemList<StringValue>>)Parameters[InputVariablesParameterName]; } 48 } 54 get { 55 if (inputVariablesParameter == null) inputVariablesParameter = (IFixedValueParameter<ReadOnlyCheckedItemList<StringValue>>)Parameters[InputVariablesParameterName]; 56 return inputVariablesParameter; 57 } 58 } 59 60 private IFixedValueParameter<IntRange> trainingPartitionParameter; 49 61 public IFixedValueParameter<IntRange> TrainingPartitionParameter { 50 get { return (IFixedValueParameter<IntRange>)Parameters[TrainingPartitionParameterName]; } 51 } 62 get { 63 if (trainingPartitionParameter == null) trainingPartitionParameter = (IFixedValueParameter<IntRange>)Parameters[TrainingPartitionParameterName]; 64 return trainingPartitionParameter; 65 } 66 } 67 68 private IFixedValueParameter<IntRange> testPartitionParameter; 52 69 public IFixedValueParameter<IntRange> TestPartitionParameter { 53 get { return (IFixedValueParameter<IntRange>)Parameters[TestPartitionParameterName]; } 54 } 70 get { 71 if (testPartitionParameter == null) testPartitionParameter = (IFixedValueParameter<IntRange>)Parameters[TestPartitionParameterName]; 72 return testPartitionParameter; 73 } 74 } 75 55 76 public IFixedValueParameter<ReadOnlyItemList<ITransformation>> TransformationsParameter { 56 77 get { return (IFixedValueParameter<ReadOnlyItemList<ITransformation>>)Parameters[TransformationsParameterName]; } … … 102 123 public virtual bool IsTrainingSample(int index) { 103 124 return index >= 0 && index < Dataset.Rows && 104 TrainingPartition.Start <= index && index < TrainingPartition.End &&105 (index < TestPartition.Start || TestPartition.End <= index);125 TrainingPartition.Start <= index && index < TrainingPartition.End && 126 (index < TestPartition.Start || TestPartition.End <= index); 106 127 } 107 128 … … 214 235 InputVariables.SetItemCheckedState(inputVariable, variable != null && data.InputVariables.ItemChecked(variable)); 215 236 } 216 217 TrainingPartition.Start = TrainingPartition.End = 0;218 TestPartition.Start = 0;219 TestPartition.End = Dataset.Rows;220 237 } 221 238 } -
branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolutionVariableImpactsCalculator.cs
r14348 r14562 122 122 } 123 123 124 125 124 var impacts = new Dictionary<string, double>(); 126 125 var modifiableDataset = ((Dataset)dataset).ToModifiable(); 127 126 128 foreach (var inputVariable in problemData.AllowedInputVariables) { 127 var inputvariables = new HashSet<string>(problemData.AllowedInputVariables.Union(solution.Model.VariablesUsedForPrediction)); 128 var allowedInputVariables = dataset.VariableNames.Where(v => inputvariables.Contains(v)).ToList(); 129 130 foreach (var inputVariable in allowedInputVariables) { 129 131 var newEstimates = EvaluateModelWithReplacedVariable(solution.Model, inputVariable, modifiableDataset, rows, replacement); 130 132 var newR2 = OnlinePearsonsRCalculator.Calculate(targetValues, newEstimates, out error); -
branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/TimeSeriesPrognosis/TimeSeriesPrognosisSolution.cs
r14185 r14562 21 21 22 22 using System.Collections.Generic; 23 using System.Linq; 23 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 43 44 return Model.GetPrognosedValues(ProblemData.Dataset, rows, horizons); 44 45 } 46 47 public override IEnumerable<double> PrognosedTestValues { 48 get { 49 return Model.GetPrognosedValues(ProblemData.Dataset, ProblemData.TestIndices.Take(1), 50 new int[] { ProblemData.TestIndices.Count() }).First(); 51 } 52 } 45 53 } 46 54 } -
branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/TimeSeriesPrognosis/TimeSeriesPrognosisSolutionBase.cs
r14185 r14562 64 64 } 65 65 66 public abstract IEnumerable<double> PrognosedTestValues { get; } 66 67 public abstract IEnumerable<IEnumerable<double>> GetPrognosedValues(IEnumerable<int> rows, IEnumerable<int> horizon); 67 68 … … 150 151 OnlineCalculatorError errorState; 151 152 double trainingMean = ProblemData.TrainingIndices.Any() ? ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndices).Average() : double.NaN; 152 var meanModel = new ConstantModel(trainingMean, ProblemData.TargetVariable);153 var meanModel = new ConstantModel(trainingMean, ProblemData.TargetVariable); 153 154 154 155 double alpha, beta; -
branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/TimeSeriesPrognosis/ITimeSeriesPrognosisSolution.cs
r14185 r14562 28 28 IEnumerable<IEnumerable<double>> GetPrognosedValues(IEnumerable<int> rows, IEnumerable<int> horizon); 29 29 30 IEnumerable<double> PrognosedTestValues { get; } 31 30 32 double TrainingTheilsUStatisticAR1 { get; } 31 33 double TestTheilsUStatisticAR1 { get; } -
branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/ClassificationPerformanceMeasuresCalculator.cs
r14376 r14562 33 33 } 34 34 35 protected ClassificationPerformanceMeasuresCalculator(ClassificationPerformanceMeasuresCalculator original, Cloner cloner) { 35 protected ClassificationPerformanceMeasuresCalculator(ClassificationPerformanceMeasuresCalculator original, Cloner cloner) 36 : base(original, cloner) { 36 37 positiveClassName = original.positiveClassName; 37 38 positiveClassValue = original.positiveClassValue; … … 41 42 falseNegativeCount = original.falseNegativeCount; 42 43 errorState = original.errorState; 44 } 45 public override IDeepCloneable Clone(Cloner cloner) { 46 return new ClassificationPerformanceMeasuresCalculator(this, cloner); 43 47 } 44 48 … … 147 151 errorState = ErrorState; 148 152 } 149 150 public override IDeepCloneable Clone(Cloner cloner) {151 return new ClassificationPerformanceMeasuresCalculator(this, cloner);152 }153 153 } 154 154 } -
branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineBoundedMeanSquaredErrorCalculator.cs
r14376 r14562 45 45 } 46 46 47 protected OnlineBoundedMeanSquaredErrorCalculator(OnlineBoundedMeanSquaredErrorCalculator original, Cloner cloner) { 47 protected OnlineBoundedMeanSquaredErrorCalculator(OnlineBoundedMeanSquaredErrorCalculator original, Cloner cloner) 48 : base(original, cloner) { 48 49 LowerBound = original.LowerBound; 49 50 UpperBound = original.UpperBound; … … 51 52 errorSum = original.errorSum; 52 53 errorState = original.ErrorState; 54 } 55 public override IDeepCloneable Clone(Cloner cloner) { 56 return new OnlineBoundedMeanSquaredErrorCalculator(this, cloner); 53 57 } 54 58 … … 105 109 } 106 110 } 107 108 // IDeepCloneable interface members109 public override IDeepCloneable Clone(Cloner cloner) {110 return new OnlineBoundedMeanSquaredErrorCalculator(this, cloner);111 }112 111 } 113 112 } -
branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineCovarianceCalculator.cs
r14376 r14562 39 39 } 40 40 41 protected OnlineCovarianceCalculator(OnlineCovarianceCalculator other, Cloner cloner) { 42 Cn = other.Cn; 43 xMean = other.xMean; 44 yMean = other.yMean; 45 n = other.n; 46 errorState = other.errorState; 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); 47 52 } 48 53 … … 103 108 } 104 109 } 105 106 public override IDeepCloneable Clone(Cloner cloner) {107 return new OnlineCovarianceCalculator(this, cloner);108 }109 110 } 110 111 } -
branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineDirectionalSymmetryCalculator.cs
r14376 r14562 41 41 } 42 42 43 protected OnlineDirectionalSymmetryCalculator(OnlineDirectionalSymmetryCalculator other, Cloner cloner = null) { 44 n = other.n; 45 nCorrect = other.nCorrect; 46 errorState = other.errorState; 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); 47 52 } 48 53 … … 122 127 } 123 128 } 124 125 public override IDeepCloneable Clone(Cloner cloner) {126 return new OnlineDirectionalSymmetryCalculator(this, cloner);127 }128 129 } 129 130 } -
branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineLinearScalingParameterCalculator.cs
r14376 r14562 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() { … … 66 66 } 67 67 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); 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); 72 73 // do not reset the calculators here 74 } 75 public override IDeepCloneable Clone(Cloner cloner) { 76 return new OnlineLinearScalingParameterCalculator(this, cloner); 73 77 } 74 78 … … 125 129 } 126 130 } 127 128 public override IDeepCloneable Clone(Cloner cloner) {129 return new OnlineLinearScalingParameterCalculator(this, cloner);130 }131 131 } 132 132 } -
branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineMaxAbsoluteErrorCalculator.cs
r14376 r14562 39 39 } 40 40 41 protected OnlineMaxAbsoluteErrorCalculator(OnlineMaxAbsoluteErrorCalculator other, Cloner cloner = null) { 42 mae = other.mae; 43 n = other.n; 44 errorState = other.errorState; 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); 45 49 } 46 50 … … 95 99 } 96 100 } 97 98 public override IDeepCloneable Clone(Cloner cloner) {99 return new OnlineMaxAbsoluteErrorCalculator(this, cloner);100 }101 101 } 102 102 } -
branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineMeanAbsoluteErrorCalculator.cs
r14376 r14562 39 39 } 40 40 41 protected OnlineMeanAbsoluteErrorCalculator(OnlineMeanAbsoluteErrorCalculator other, Cloner cloner = null) { 42 sae = other.sae; 43 n = other.n; 44 errorState = other.errorState; 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); 45 49 } 46 50 … … 94 98 } 95 99 } 96 97 public override IDeepCloneable Clone(Cloner cloner) {98 return new OnlineMeanAbsoluteErrorCalculator(this, cloner);99 }100 100 } 101 101 } -
branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineMeanAbsolutePercentageErrorCalculator.cs
r14376 r14562 39 39 } 40 40 41 protected OnlineMeanAbsolutePercentageErrorCalculator(OnlineMeanAbsolutePercentageErrorCalculator other, Cloner cloner = null) { 42 sre = other.sre; 43 n = other.n; 44 errorState = other.errorState; 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); 45 50 } 46 51 … … 95 100 } 96 101 } 97 98 public override IDeepCloneable Clone(Cloner cloner) {99 return new OnlineMeanAbsolutePercentageErrorCalculator(this, cloner);100 }101 102 } 102 103 } -
branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineMeanAndVarianceCalculator.cs
r14376 r14562 67 67 } 68 68 69 protected OnlineMeanAndVarianceCalculator(OnlineMeanAndVarianceCalculator other, Cloner cloner = null) { 70 m_oldS = other.m_oldS; 71 m_oldM = other.m_oldM; 72 m_newS = other.m_newS; 73 m_newM = other.m_newM; 74 n = other.n; 75 errorState = other.errorState; 76 varianceErrorState = other.varianceErrorState; 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); 77 81 } 78 82 … … 117 121 varianceErrorState = meanAndVarianceCalculator.VarianceErrorState; 118 122 } 119 120 public override IDeepCloneable Clone(Cloner cloner) {121 return new OnlineMeanAndVarianceCalculator(this, cloner);122 }123 123 } 124 124 } -
branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineMeanErrorCalculator.cs
r14376 r14562 37 37 } 38 38 39 protected OnlineMeanErrorCalculator(OnlineMeanErrorCalculator other, Cloner cloner) { 40 meanAndVarianceCalculator = (OnlineMeanAndVarianceCalculator)other.meanAndVarianceCalculator.Clone(cloner); 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); 41 45 } 42 46 … … 79 83 } 80 84 } 81 82 public override IDeepCloneable Clone(Cloner cloner) {83 return new OnlineMeanErrorCalculator(this, cloner);84 }85 85 } 86 86 } -
branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineMeanSquaredErrorCalculator.cs
r14376 r14562 39 39 } 40 40 41 protected OnlineMeanSquaredErrorCalculator(OnlineMeanSquaredErrorCalculator other, Cloner cloner = null) { 42 sse = other.sse; 43 n = other.n; 44 errorState = other.errorState; 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); 45 49 } 46 50 … … 94 98 } 95 99 } 96 97 public override IDeepCloneable Clone(Cloner cloner) {98 return new OnlineMeanSquaredErrorCalculator(this, cloner);99 }100 100 } 101 101 } -
branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineNormalizedMeanSquaredErrorCalculator.cs
r14376 r14562 43 43 } 44 44 45 protected OnlineNormalizedMeanSquaredErrorCalculator(OnlineNormalizedMeanSquaredErrorCalculator other, Cloner cloner) { 46 meanSquaredErrorCalculator = (OnlineMeanAndVarianceCalculator)other.meanSquaredErrorCalculator.Clone(cloner); 47 originalVarianceCalculator = (OnlineMeanAndVarianceCalculator)other.originalVarianceCalculator.Clone(cloner); 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); 48 52 } 49 53 … … 99 103 } 100 104 101 public override IDeepCloneable Clone(Cloner cloner) { 102 return new OnlineNormalizedMeanSquaredErrorCalculator(this, cloner); 103 } 105 104 106 } 105 107 } -
branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlinePearsonsRCalculator.cs
r14376 r14562 47 47 public OnlinePearsonsRCalculator() { } 48 48 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); 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); 53 57 } 54 58 … … 97 101 } 98 102 } 99 100 public override IDeepCloneable Clone(Cloner cloner) {101 return new OnlinePearsonsRCalculator(this, cloner);102 }103 103 } 104 104 } -
branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlinePearsonsRSquaredCalculator.cs
r14376 r14562 38 38 public OnlinePearsonsRSquaredCalculator() { } 39 39 40 protected OnlinePearsonsRSquaredCalculator(OnlinePearsonsRSquaredCalculator other, Cloner cloner) { 41 this.rCalculator = (OnlinePearsonsRCalculator)other.rCalculator.Clone(cloner); 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); 42 46 } 43 47 … … 64 68 } 65 69 66 public override IDeepCloneable Clone(Cloner cloner) { 67 return new OnlinePearsonsRSquaredCalculator(this, cloner); 68 } 70 69 71 } 70 72 } -
branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineTheilsUStatisticCalculator.cs
r14376 r14562 26 26 namespace HeuristicLab.Problems.DataAnalysis { 27 27 public class OnlineTheilsUStatisticCalculator : DeepCloneable, IOnlineTimeSeriesCalculator { 28 private OnlineMeanAndVarianceCalculator squaredErrorMeanCalculator;29 private OnlineMeanAndVarianceCalculator unbiasedEstimatorMeanCalculator;28 private readonly OnlineMeanAndVarianceCalculator squaredErrorMeanCalculator; 29 private readonly OnlineMeanAndVarianceCalculator unbiasedEstimatorMeanCalculator; 30 30 31 31 public double TheilsUStatistic { … … 46 46 } 47 47 48 protected OnlineTheilsUStatisticCalculator(OnlineTheilsUStatisticCalculator other, Cloner cloner) { 49 squaredErrorMeanCalculator = (OnlineMeanAndVarianceCalculator)other.squaredErrorMeanCalculator.Clone(cloner); 50 unbiasedEstimatorMeanCalculator = (OnlineMeanAndVarianceCalculator)other.unbiasedEstimatorMeanCalculator.Clone(cloner); 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); 51 55 } 52 56 … … 131 135 } 132 136 } 133 134 public override IDeepCloneable Clone(Cloner cloner) {135 return new OnlineTheilsUStatisticCalculator(this, cloner);136 }137 137 } 138 138 } -
branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineWeightedDirectionalSymmetryCalculator.cs
r14376 r14562 42 42 } 43 43 44 protected OnlineWeightedDirectionalSymmetryCalculator(OnlineWeightedDirectionalSymmetryCalculator other, Cloner cloner) { 45 n = other.n; 46 correctSum = other.correctSum; 47 incorrectSum = other.incorrectSum; 48 errorState = other.errorState; 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); 49 54 } 50 55 … … 125 130 } 126 131 } 127 128 public override IDeepCloneable Clone(Cloner cloner) {129 return new OnlineWeightedDirectionalSymmetryCalculator(this, cloner);130 }131 132 } 132 133 }
Note: See TracChangeset
for help on using the changeset viewer.