Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/13/17 12:55:06 (8 years ago)
Author:
abeham
Message:

#2701: Updated branch to trunk

Location:
branches/MemPRAlgorithm
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • branches/MemPRAlgorithm

  • branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis

  • branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblemData.cs

    r14400 r14562  
    4141
    4242    #region parameter properites
     43    //mkommend: inserted parameter caching due to performance reasons
     44    private IFixedValueParameter<Dataset> datasetParameter;
    4345    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;
    4653    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;
    4961    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;
    5269    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
    5576    public IFixedValueParameter<ReadOnlyItemList<ITransformation>> TransformationsParameter {
    5677      get { return (IFixedValueParameter<ReadOnlyItemList<ITransformation>>)Parameters[TransformationsParameterName]; }
     
    102123    public virtual bool IsTrainingSample(int index) {
    103124      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);
    106127    }
    107128
     
    214235        InputVariables.SetItemCheckedState(inputVariable, variable != null && data.InputVariables.ItemChecked(variable));
    215236      }
    216 
    217       TrainingPartition.Start = TrainingPartition.End = 0;
    218       TestPartition.Start = 0;
    219       TestPartition.End = Dataset.Rows;
    220237    }
    221238  }
  • branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolutionVariableImpactsCalculator.cs

    r14348 r14562  
    122122      }
    123123
    124 
    125124      var impacts = new Dictionary<string, double>();
    126125      var modifiableDataset = ((Dataset)dataset).ToModifiable();
    127126
    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) {
    129131        var newEstimates = EvaluateModelWithReplacedVariable(solution.Model, inputVariable, modifiableDataset, rows, replacement);
    130132        var newR2 = OnlinePearsonsRCalculator.Calculate(targetValues, newEstimates, out error);
  • branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/TimeSeriesPrognosis/TimeSeriesPrognosisSolution.cs

    r14185 r14562  
    2121
    2222using System.Collections.Generic;
     23using System.Linq;
    2324using HeuristicLab.Common;
    2425using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    4344      return Model.GetPrognosedValues(ProblemData.Dataset, rows, horizons);
    4445    }
     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    }
    4553  }
    4654}
  • branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/TimeSeriesPrognosis/TimeSeriesPrognosisSolutionBase.cs

    r14185 r14562  
    6464    }
    6565
     66    public abstract IEnumerable<double> PrognosedTestValues { get; }
    6667    public abstract IEnumerable<IEnumerable<double>> GetPrognosedValues(IEnumerable<int> rows, IEnumerable<int> horizon);
    6768
     
    150151      OnlineCalculatorError errorState;
    151152      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);
    153154
    154155      double alpha, beta;
  • branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/TimeSeriesPrognosis/ITimeSeriesPrognosisSolution.cs

    r14185 r14562  
    2828    IEnumerable<IEnumerable<double>> GetPrognosedValues(IEnumerable<int> rows, IEnumerable<int> horizon);
    2929
     30    IEnumerable<double> PrognosedTestValues { get; }
     31
    3032    double TrainingTheilsUStatisticAR1 { get; }
    3133    double TestTheilsUStatisticAR1 { get; }
  • branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/ClassificationPerformanceMeasuresCalculator.cs

    r14376 r14562  
    3333    }
    3434
    35     protected ClassificationPerformanceMeasuresCalculator(ClassificationPerformanceMeasuresCalculator original, Cloner cloner) {
     35    protected ClassificationPerformanceMeasuresCalculator(ClassificationPerformanceMeasuresCalculator original, Cloner cloner)
     36      : base(original, cloner) {
    3637      positiveClassName = original.positiveClassName;
    3738      positiveClassValue = original.positiveClassValue;
     
    4142      falseNegativeCount = original.falseNegativeCount;
    4243      errorState = original.errorState;
     44    }
     45    public override IDeepCloneable Clone(Cloner cloner) {
     46      return new ClassificationPerformanceMeasuresCalculator(this, cloner);
    4347    }
    4448
     
    147151      errorState = ErrorState;
    148152    }
    149 
    150     public override IDeepCloneable Clone(Cloner cloner) {
    151       return new ClassificationPerformanceMeasuresCalculator(this, cloner);
    152     }
    153153  }
    154154}
  • branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineBoundedMeanSquaredErrorCalculator.cs

    r14376 r14562  
    4545    }
    4646
    47     protected OnlineBoundedMeanSquaredErrorCalculator(OnlineBoundedMeanSquaredErrorCalculator original, Cloner cloner) {
     47    protected OnlineBoundedMeanSquaredErrorCalculator(OnlineBoundedMeanSquaredErrorCalculator original, Cloner cloner)
     48      : base(original, cloner) {
    4849      LowerBound = original.LowerBound;
    4950      UpperBound = original.UpperBound;
     
    5152      errorSum = original.errorSum;
    5253      errorState = original.ErrorState;
     54    }
     55    public override IDeepCloneable Clone(Cloner cloner) {
     56      return new OnlineBoundedMeanSquaredErrorCalculator(this, cloner);
    5357    }
    5458
     
    105109      }
    106110    }
    107 
    108     // IDeepCloneable interface members
    109     public override IDeepCloneable Clone(Cloner cloner) {
    110       return new OnlineBoundedMeanSquaredErrorCalculator(this, cloner);
    111     }
    112111  }
    113112}
  • branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineCovarianceCalculator.cs

    r14376 r14562  
    3939    }
    4040
    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);
    4752    }
    4853
     
    103108      }
    104109    }
    105 
    106     public override IDeepCloneable Clone(Cloner cloner) {
    107       return new OnlineCovarianceCalculator(this, cloner);
    108     }
    109110  }
    110111}
  • branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineDirectionalSymmetryCalculator.cs

    r14376 r14562  
    4141    }
    4242
    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);
    4752    }
    4853
     
    122127      }
    123128    }
    124 
    125     public override IDeepCloneable Clone(Cloner cloner) {
    126       return new OnlineDirectionalSymmetryCalculator(this, cloner);
    127     }
    128129  }
    129130}
  • branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineLinearScalingParameterCalculator.cs

    r14376 r14562  
    5555    }
    5656
    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;
    6060
    6161    public OnlineLinearScalingParameterCalculator() {
     
    6666    }
    6767
    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);
    7273      // do not reset the calculators here
     74    }
     75    public override IDeepCloneable Clone(Cloner cloner) {
     76      return new OnlineLinearScalingParameterCalculator(this, cloner);
    7377    }
    7478
     
    125129      }
    126130    }
    127 
    128     public override IDeepCloneable Clone(Cloner cloner) {
    129       return new OnlineLinearScalingParameterCalculator(this, cloner);
    130     }
    131131  }
    132132}
  • branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineMaxAbsoluteErrorCalculator.cs

    r14376 r14562  
    3939    }
    4040
    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);
    4549    }
    4650
     
    9599      }
    96100    }
    97 
    98     public override IDeepCloneable Clone(Cloner cloner) {
    99       return new OnlineMaxAbsoluteErrorCalculator(this, cloner);
    100     }
    101101  }
    102102}
  • branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineMeanAbsoluteErrorCalculator.cs

    r14376 r14562  
    3939    }
    4040
    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);
    4549    }
    4650
     
    9498      }
    9599    }
    96 
    97     public override IDeepCloneable Clone(Cloner cloner) {
    98       return new OnlineMeanAbsoluteErrorCalculator(this, cloner);
    99     }
    100100  }
    101101}
  • branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineMeanAbsolutePercentageErrorCalculator.cs

    r14376 r14562  
    3939    }
    4040
    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);
    4550    }
    4651
     
    95100      }
    96101    }
    97 
    98     public override IDeepCloneable Clone(Cloner cloner) {
    99       return new OnlineMeanAbsolutePercentageErrorCalculator(this, cloner);
    100     }
    101102  }
    102103}
  • branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineMeanAndVarianceCalculator.cs

    r14376 r14562  
    6767    }
    6868
    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);
    7781    }
    7882
     
    117121      varianceErrorState = meanAndVarianceCalculator.VarianceErrorState;
    118122    }
    119 
    120     public override IDeepCloneable Clone(Cloner cloner) {
    121       return new OnlineMeanAndVarianceCalculator(this, cloner);
    122     }
    123123  }
    124124}
  • branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineMeanErrorCalculator.cs

    r14376 r14562  
    3737    }
    3838
    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);
    4145    }
    4246
     
    7983      }
    8084    }
    81 
    82     public override IDeepCloneable Clone(Cloner cloner) {
    83       return new OnlineMeanErrorCalculator(this, cloner);
    84     }
    8585  }
    8686}
  • branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineMeanSquaredErrorCalculator.cs

    r14376 r14562  
    3939    }
    4040
    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);
    4549    }
    4650
     
    9498      }
    9599    }
    96 
    97     public override IDeepCloneable Clone(Cloner cloner) {
    98       return new OnlineMeanSquaredErrorCalculator(this, cloner);
    99     }
    100100  }
    101101}
  • branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineNormalizedMeanSquaredErrorCalculator.cs

    r14376 r14562  
    4343    }
    4444
    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);
    4852    }
    4953
     
    99103    }
    100104
    101     public override IDeepCloneable Clone(Cloner cloner) {
    102       return new OnlineNormalizedMeanSquaredErrorCalculator(this, cloner);
    103     }
     105
    104106  }
    105107}
  • branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlinePearsonsRCalculator.cs

    r14376 r14562  
    4747    public OnlinePearsonsRCalculator() { }
    4848
    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);
    5357    }
    5458
     
    97101      }
    98102    }
    99 
    100     public override IDeepCloneable Clone(Cloner cloner) {
    101       return new OnlinePearsonsRCalculator(this, cloner);
    102     }
    103103  }
    104104}
  • branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlinePearsonsRSquaredCalculator.cs

    r14376 r14562  
    3838    public OnlinePearsonsRSquaredCalculator() { }
    3939
    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);
    4246    }
    4347
     
    6468    }
    6569
    66     public override IDeepCloneable Clone(Cloner cloner) {
    67       return new OnlinePearsonsRSquaredCalculator(this, cloner);
    68     }
     70
    6971  }
    7072}
  • branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineTheilsUStatisticCalculator.cs

    r14376 r14562  
    2626namespace HeuristicLab.Problems.DataAnalysis {
    2727  public class OnlineTheilsUStatisticCalculator : DeepCloneable, IOnlineTimeSeriesCalculator {
    28     private OnlineMeanAndVarianceCalculator squaredErrorMeanCalculator;
    29     private OnlineMeanAndVarianceCalculator unbiasedEstimatorMeanCalculator;
     28    private readonly OnlineMeanAndVarianceCalculator squaredErrorMeanCalculator;
     29    private readonly OnlineMeanAndVarianceCalculator unbiasedEstimatorMeanCalculator;
    3030
    3131    public double TheilsUStatistic {
     
    4646    }
    4747
    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);
    5155    }
    5256
     
    131135      }
    132136    }
    133 
    134     public override IDeepCloneable Clone(Cloner cloner) {
    135       return new OnlineTheilsUStatisticCalculator(this, cloner);
    136     }
    137137  }
    138138}
  • branches/MemPRAlgorithm/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineWeightedDirectionalSymmetryCalculator.cs

    r14376 r14562  
    4242    }
    4343
    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);
    4954    }
    5055
     
    125130      }
    126131    }
    127 
    128     public override IDeepCloneable Clone(Cloner cloner) {
    129       return new OnlineWeightedDirectionalSymmetryCalculator(this, cloner);
    130     }
    131132  }
    132133}
Note: See TracChangeset for help on using the changeset viewer.