Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/11/11 15:03:46 (14 years ago)
Author:
gkronber
Message:

Merged changes from trunk to data analysis exploration branch and added fractional distance metric evaluator. #1142

Location:
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression/3.3/Symbolic
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression/3.3/Symbolic/Analyzer/ValidationBestScaledSymbolicVectorRegressionSolutionAnalyzer.cs

    r4194 r5275  
    3333using HeuristicLab.Problems.DataAnalysis.Symbolic;
    3434using HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression.Symbolic.Interfaces;
     35using HeuristicLab.Common;
    3536
    3637namespace HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression.Symbolic.Analyzers {
     
    133134    }
    134135    #endregion
    135 
     136    [StorableConstructor]
     137    protected ValidationBestScaledSymbolicVectorRegressionSolutionAnalyzer(bool deserializing) : base(deserializing) { }
     138    protected ValidationBestScaledSymbolicVectorRegressionSolutionAnalyzer(ValidationBestScaledSymbolicVectorRegressionSolutionAnalyzer original, Cloner cloner)
     139      : base(original, cloner) {
     140    }
    136141    public ValidationBestScaledSymbolicVectorRegressionSolutionAnalyzer()
    137142      : base() {
     
    151156      Parameters.Add(new LookupParameter<ResultCollection>(ResultsParameterName, "The result collection where the best symbolic regression solution should be stored."));
    152157      Parameters.Add(new LookupParameter<DoubleValue>(BestKnownQualityParameterName, "The best known (validation) quality achieved on the data set."));
    153 
     158    }
     159
     160    public override IDeepCloneable Clone(Cloner cloner) {
     161      return new ValidationBestScaledSymbolicVectorRegressionSolutionAnalyzer(this, cloner);
    154162    }
    155163
  • branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression/3.3/Symbolic/Evaluators/MultiObjectiveSymbolicVectorRegressionEvaluator.cs

    r4401 r5275  
    3232using HeuristicLab.Problems.DataAnalysis.Symbolic;
    3333using HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression.Symbolic.Interfaces;
     34using HeuristicLab.Common;
    3435
    3536namespace HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression.Symbolic.Evaluators {
     
    4243    }
    4344    #endregion
    44     public MultiObjectiveSymbolicVectorRegressionEvaluator(bool deserializing) : base(deserializing) { }
     45    [StorableConstructor]
     46    protected MultiObjectiveSymbolicVectorRegressionEvaluator(bool deserializing) : base(deserializing) { }
     47    protected MultiObjectiveSymbolicVectorRegressionEvaluator(MultiObjectiveSymbolicVectorRegressionEvaluator original, Cloner cloner)
     48      : base(original, cloner) {
     49    }
    4550    public MultiObjectiveSymbolicVectorRegressionEvaluator()
    4651      : base() {
  • branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression/3.3/Symbolic/Evaluators/PartialDerivativeEvaluator.cs

    r4197 r5275  
    3939  public class PartialDerivativeEvaluator : SingleObjectiveSymbolicVectorRegressionEvaluator {
    4040
    41     public PartialDerivativeEvaluator(bool deserializing) : base(deserializing) { }
     41    [StorableConstructor]
     42    protected PartialDerivativeEvaluator(bool deserializing) : base(deserializing) { }
     43    protected PartialDerivativeEvaluator(PartialDerivativeEvaluator original, Cloner cloner)
     44      : base(original, cloner) {
     45    }
    4246    public PartialDerivativeEvaluator()
    4347      : base() {
    4448    }
    45 
     49    public override IDeepCloneable Clone(Cloner cloner) {
     50      return new PartialDerivativeEvaluator(this, cloner);
     51    }
    4652    public override double Evaluate(SymbolicExpressionTree tree, ISymbolicExpressionTreeInterpreter interpreter, MultiVariateDataAnalysisProblemData problemData, IEnumerable<string> targetVariables, IEnumerable<int> rows, DoubleArray lowerEstimationBound, DoubleArray upperEstimationBound) {
    4753
  • branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression/3.3/Symbolic/Evaluators/SingleObjectiveSymbolicVectorRegressionEvaluator.cs

    r4401 r5275  
    3232using HeuristicLab.Problems.DataAnalysis.Symbolic;
    3333using HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression.Symbolic.Interfaces;
     34using HeuristicLab.Common;
    3435
    3536namespace HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression.Symbolic.Evaluators {
     
    4243    }
    4344    #endregion
    44     public SingleObjectiveSymbolicVectorRegressionEvaluator(bool deserializing) : base(deserializing) { }
     45    [StorableConstructor]
     46    protected SingleObjectiveSymbolicVectorRegressionEvaluator(bool deserializing) : base(deserializing) { }
     47    protected SingleObjectiveSymbolicVectorRegressionEvaluator(SingleObjectiveSymbolicVectorRegressionEvaluator original, Cloner cloner)
     48      : base(original, cloner) {
     49    }
    4550    public SingleObjectiveSymbolicVectorRegressionEvaluator()
    4651      : base() {
    4752      Parameters.Add(new LookupParameter<DoubleValue>(QualityParameterName, "The quality of the symbolic vector regression solution."));
    4853    }
    49 
    5054
    5155    public override IOperation Apply() {
  • branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression/3.3/Symbolic/Evaluators/SymbolicRegressionNormalizedMeanSquaredErrorEvaluator.cs

    r4194 r5275  
    2929using HeuristicLab.Problems.DataAnalysis.Evaluators;
    3030using HeuristicLab.Problems.DataAnalysis.Symbolic;
     31using HeuristicLab.Common;
    3132
    3233namespace HeuristicLab.Problems.DataAnalysis.Regression.Symbolic {
     
    3435  [StorableClass]
    3536  public class SymbolicRegressionNormalizedMeanSquaredErrorEvaluator : SingleObjectiveSymbolicRegressionEvaluator {
     37    [StorableConstructor]
     38    protected SymbolicRegressionNormalizedMeanSquaredErrorEvaluator(bool deserializing) : base(deserializing) { }
     39    protected SymbolicRegressionNormalizedMeanSquaredErrorEvaluator(SymbolicRegressionNormalizedMeanSquaredErrorEvaluator original, Cloner cloner)
     40      : base(original, cloner) {
     41    }
    3642    public SymbolicRegressionNormalizedMeanSquaredErrorEvaluator()
    3743      : base() {
    3844    }
    39 
     45    public override IDeepCloneable Clone(Cloner cloner) {
     46      return new SymbolicRegressionNormalizedMeanSquaredErrorEvaluator(this, cloner);
     47    }
    4048    public override double Evaluate(ISymbolicExpressionTreeInterpreter interpreter, SymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, Dataset dataset, string targetVariable, IEnumerable<int> rows) {
    4149      double nmse = Calculate(interpreter, solution, lowerEstimationLimit, upperEstimationLimit, dataset, targetVariable, rows);
  • branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression/3.3/Symbolic/Evaluators/SymbolicVectorRegressionEvaluator.cs

    r4401 r5275  
    3131using HeuristicLab.Problems.DataAnalysis.Regression;
    3232using HeuristicLab.Problems.DataAnalysis.Symbolic;
     33using HeuristicLab.Common;
    3334
    3435namespace HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression.Symbolic.Evaluators {
     
    105106    #endregion
    106107
    107     public SymbolicVectorRegressionEvaluator(bool deserializing) : base(deserializing) { }
     108    [StorableConstructor]
     109    protected SymbolicVectorRegressionEvaluator(bool deserializing) : base(deserializing) { }
     110    protected SymbolicVectorRegressionEvaluator(SymbolicVectorRegressionEvaluator original, Cloner cloner)
     111      : base(original, cloner) {
     112    }
    108113    public SymbolicVectorRegressionEvaluator()
    109114      : base() {
     
    118123      Parameters.Add(new ValueParameter<PercentValue>(RelativeNumberOfEvaluatedSamplesParameterName, "The relative number of samples of the dataset partition, which should be randomly chosen for evaluation between the start and end index.", new PercentValue(1)));
    119124    }
    120 
    121125    public static IEnumerable<int> GenerateRowsToEvaluate(int seed, double relativeAmount, int start, int end) {
    122126      if (end < start) throw new ArgumentException("Start value is larger than end value.");
  • branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression/3.3/Symbolic/Evaluators/SymbolicVectorRegressionNormalizedMseEvaluator.cs

    r4194 r5275  
    3030using HeuristicLab.Problems.DataAnalysis.Regression.Symbolic;
    3131using HeuristicLab.Problems.DataAnalysis.Symbolic;
     32using HeuristicLab.Common;
    3233
    3334namespace HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression.Symbolic.Evaluators {
     
    3738
    3839
    39     public SymbolicVectorRegressionNormalizedMseEvaluator(bool deserializing) : base(deserializing) { }
     40    [StorableConstructor]
     41    protected SymbolicVectorRegressionNormalizedMseEvaluator(bool deserializing) : base(deserializing) { }
     42    protected SymbolicVectorRegressionNormalizedMseEvaluator(SymbolicVectorRegressionNormalizedMseEvaluator original, Cloner cloner)
     43      : base(original, cloner) {
     44    }
    4045    public SymbolicVectorRegressionNormalizedMseEvaluator()
    4146      : base() {
     47    }
     48    public override IDeepCloneable Clone(Cloner cloner) {
     49      return new SymbolicVectorRegressionNormalizedMseEvaluator(this, cloner);
    4250    }
    4351
  • branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression/3.3/Symbolic/Evaluators/SymbolicVectorRegressionScaledMseEvaluator.cs

    r4194 r5275  
    3030using HeuristicLab.Problems.DataAnalysis.Regression.Symbolic;
    3131using HeuristicLab.Problems.DataAnalysis.Symbolic;
     32using HeuristicLab.Common;
    3233
    3334namespace HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression.Symbolic.Evaluators {
     
    4849    #endregion
    4950
     51    [StorableConstructor]
     52    protected SymbolicVectorRegressionScaledMseEvaluator(bool deserializing) : base(deserializing) { }
     53    protected SymbolicVectorRegressionScaledMseEvaluator(SymbolicVectorRegressionScaledMseEvaluator original, Cloner cloner)
     54      : base(original, cloner) {
     55    }
    5056    public SymbolicVectorRegressionScaledMseEvaluator()
    5157      : base() {
     
    5359      Parameters.Add(new LookupParameter<DoubleArray>(BetaParameterName, "The beta parameter for linear scaling."));
    5460    }
    55 
     61    public override IDeepCloneable Clone(Cloner cloner) {
     62      return new SymbolicVectorRegressionScaledMseEvaluator(this, cloner);
     63    }
    5664    public override double[] Evaluate(SymbolicExpressionTree tree, ISymbolicExpressionTreeInterpreter interpreter, MultiVariateDataAnalysisProblemData problemData, IEnumerable<string> targetVariables, IEnumerable<int> rows, DoubleArray lowerEstimationBound, DoubleArray upperEstimationBound) {
    5765      List<string> targetVariablesList = targetVariables.ToList();
  • branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression/3.3/Symbolic/Evaluators/SymbolicVectorRegressionScaledNormalizedMseEvaluator.cs

    r4194 r5275  
    3030using HeuristicLab.Problems.DataAnalysis.Regression.Symbolic;
    3131using HeuristicLab.Problems.DataAnalysis.Symbolic;
     32using HeuristicLab.Common;
    3233
    3334namespace HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression.Symbolic.Evaluators {
     
    4849    #endregion
    4950
     51    [StorableConstructor]
     52    protected SymbolicVectorRegressionScaledNormalizedMseEvaluator(bool deserializing) : base(deserializing) { }
     53    protected SymbolicVectorRegressionScaledNormalizedMseEvaluator(SymbolicVectorRegressionScaledNormalizedMseEvaluator original, Cloner cloner)
     54      : base(original, cloner) {
     55    }
    5056    public SymbolicVectorRegressionScaledNormalizedMseEvaluator()
    5157      : base() {
     
    5359      Parameters.Add(new LookupParameter<DoubleArray>(BetaParameterName, "The beta parameter for linear scaling."));
    5460    }
    55 
     61    public override IDeepCloneable Clone(Cloner cloner) {
     62      return new SymbolicVectorRegressionScaledNormalizedMseEvaluator(this, cloner);
     63    }
    5664    public override double Evaluate(SymbolicExpressionTree tree, ISymbolicExpressionTreeInterpreter interpreter, MultiVariateDataAnalysisProblemData problemData, IEnumerable<string> targetVariables, IEnumerable<int> rows, DoubleArray lowerEstimationBound, DoubleArray upperEstimationBound) {
    5765      List<string> targetVariablesList = targetVariables.ToList();
  • branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression/3.3/Symbolic/MultiObjectiveSymbolicVectorRegressionProblem.cs

    r4118 r5275  
    6868    [StorableConstructor]
    6969    protected MultiObjectiveSymbolicVectorRegressionProblem(bool deserializing) : base(deserializing) { }
     70    protected MultiObjectiveSymbolicVectorRegressionProblem(MultiObjectiveSymbolicVectorRegressionProblem original, Cloner cloner)
     71      : base(original, cloner) {
     72        Initialize();
     73    }
    7074    public MultiObjectiveSymbolicVectorRegressionProblem()
    7175      : base() {
     
    8488
    8589    public override IDeepCloneable Clone(Cloner cloner) {
    86       MultiObjectiveSymbolicVectorRegressionProblem clone = (MultiObjectiveSymbolicVectorRegressionProblem)base.Clone(cloner);
    87       clone.Initialize();
    88       return clone;
     90      return new MultiObjectiveSymbolicVectorRegressionProblem(this, cloner);
    8991    }
    9092
  • branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression/3.3/Symbolic/SingleObjectiveSymbolicVectorRegressionProblem.cs

    r4087 r5275  
    7575    #endregion
    7676
     77    [StorableConstructor]
     78    private SingleObjectiveSymbolicVectorRegressionProblem(bool deserializing) : base() { }
     79    private SingleObjectiveSymbolicVectorRegressionProblem(SingleObjectiveSymbolicVectorRegressionProblem original, Cloner cloner)
     80      : base(original, cloner) {
     81        Initialize();
     82    }
    7783    public SingleObjectiveSymbolicVectorRegressionProblem()
    7884      : base() {
     
    8793    }
    8894
    89     [StorableConstructor]
    90     private SingleObjectiveSymbolicVectorRegressionProblem(bool deserializing) : base() { }
    9195
    9296    [StorableHook(HookType.AfterDeserialization)]
    93     private void AfterDeserializationHook() {
     97    private void AfterDeserialization() {
    9498      Initialize();
    9599    }
    96100
    97101    public override IDeepCloneable Clone(Cloner cloner) {
    98       SingleObjectiveSymbolicVectorRegressionProblem clone = (SingleObjectiveSymbolicVectorRegressionProblem)base.Clone(cloner);
    99       clone.Initialize();
    100       return clone;
     102      return new SingleObjectiveSymbolicVectorRegressionProblem(this, cloner);
    101103    }
    102 
    103104    private void RegisterParameterValueEvents() {
    104105      EvaluatorParameter.ValueChanged += new EventHandler(EvaluatorParameter_ValueChanged);
  • branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression/3.3/Symbolic/SymbolicVectorRegressionGrammar.cs

    r4401 r5275  
    3333  public class SymbolicVectorRegressionGrammar : MultiVariateExpressionGrammar {
    3434    public SymbolicVectorRegressionGrammar() : this(1) { }
    35 
     35    [StorableConstructor]
     36    protected SymbolicVectorRegressionGrammar(bool deserializing) : base(deserializing) { }
     37    protected SymbolicVectorRegressionGrammar(SymbolicVectorRegressionGrammar original, Cloner cloner)
     38      : base(original, cloner) {
     39    }
    3640    public SymbolicVectorRegressionGrammar(int dimension)
    3741      : base(dimension) {
    3842      Initialize();
    3943    }
    40 
    41     protected SymbolicVectorRegressionGrammar(SymbolicVectorRegressionGrammar original) : base(original.Dimension) {
    42     // fill ???
     44    public override IDeepCloneable Clone(Cloner cloner) {
     45      return new SymbolicVectorRegressionGrammar(this, cloner);
    4346    }
    4447
     
    115118      }
    116119    }
    117 
    118     public override IDeepCloneable Clone(Cloner cloner) {
    119       var clone = new SymbolicVectorRegressionGrammar(this);
    120       cloner.RegisterClonedObject(this, clone);
    121       return clone;
    122     }
    123120  }
    124121}
  • branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression/3.3/Symbolic/SymbolicVectorRegressionProblem.cs

    r4118 r5275  
    158158    [StorableConstructor]
    159159    protected SymbolicVectorRegressionProblem(bool deserializing) : base(deserializing) { }
     160    protected SymbolicVectorRegressionProblem(SymbolicVectorRegressionProblem original, Cloner cloner)
     161      : base(original, cloner) {
     162      operators = original.operators.Select(x => (IOperator)cloner.Clone(x)).ToList();
     163      RegisterParameterEvents();
     164      RegisterParameterValueEvents();
     165    }
    160166    public SymbolicVectorRegressionProblem()
    161167      : base() {
     
    184190
    185191    [StorableHook(HookType.AfterDeserialization)]
    186     private void AfterDeserializationHook() {
     192    private void AfterDeserialization() {
    187193      // BackwardsCompatibility3.3
    188194      #region Backwards compatible code (remove with 3.4)
     
    194200
    195201    public override IDeepCloneable Clone(Cloner cloner) {
    196       SymbolicVectorRegressionProblem clone = (SymbolicVectorRegressionProblem)base.Clone(cloner);
    197       clone.operators = operators.Select(x => (IOperator)cloner.Clone(x)).ToList();
    198       clone.RegisterParameterEvents();
    199       clone.RegisterParameterValueEvents();
    200       return clone;
     202      return new SymbolicVectorRegressionProblem(this, cloner);
    201203    }
    202204
  • branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression/3.3/Symbolic/SymbolicVectorRegressionSolutionLinearScaler.cs

    r4112 r5275  
    2929using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3030using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols;
     31using HeuristicLab.Common;
    3132
    3233namespace HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression.Symbolic {
     
    5455      get { return (ILookupParameter<DoubleArray>)Parameters[BetaParameterName]; }
    5556    }
    56 
     57    [StorableConstructor]
     58    protected SymbolicVectorRegressionSolutionLinearScaler(bool deserializing) : base(deserializing) { }
     59    protected SymbolicVectorRegressionSolutionLinearScaler(SymbolicVectorRegressionSolutionLinearScaler original, Cloner cloner)
     60      : base(original, cloner) {
     61    }
    5762    public SymbolicVectorRegressionSolutionLinearScaler()
    5863      : base() {
     
    6267      Parameters.Add(new LookupParameter<DoubleArray>(BetaParameterName, "Beta parameter for linear transformation."));
    6368    }
    64 
     69    public override IDeepCloneable Clone(Cloner cloner) {
     70      return new SymbolicVectorRegressionSolutionLinearScaler(this, cloner);
     71    }
    6572    public override IOperation Apply() {
    6673      SymbolicExpressionTree tree = SymbolicExpressionTreeParameter.ActualValue;
Note: See TracChangeset for help on using the changeset viewer.