Changeset 5275 for branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression/3.3/Symbolic
- Timestamp:
- 01/11/11 15:03:46 (14 years ago)
- 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 33 33 using HeuristicLab.Problems.DataAnalysis.Symbolic; 34 34 using HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression.Symbolic.Interfaces; 35 using HeuristicLab.Common; 35 36 36 37 namespace HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression.Symbolic.Analyzers { … … 133 134 } 134 135 #endregion 135 136 [StorableConstructor] 137 protected ValidationBestScaledSymbolicVectorRegressionSolutionAnalyzer(bool deserializing) : base(deserializing) { } 138 protected ValidationBestScaledSymbolicVectorRegressionSolutionAnalyzer(ValidationBestScaledSymbolicVectorRegressionSolutionAnalyzer original, Cloner cloner) 139 : base(original, cloner) { 140 } 136 141 public ValidationBestScaledSymbolicVectorRegressionSolutionAnalyzer() 137 142 : base() { … … 151 156 Parameters.Add(new LookupParameter<ResultCollection>(ResultsParameterName, "The result collection where the best symbolic regression solution should be stored.")); 152 157 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); 154 162 } 155 163 -
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression/3.3/Symbolic/Evaluators/MultiObjectiveSymbolicVectorRegressionEvaluator.cs
r4401 r5275 32 32 using HeuristicLab.Problems.DataAnalysis.Symbolic; 33 33 using HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression.Symbolic.Interfaces; 34 using HeuristicLab.Common; 34 35 35 36 namespace HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression.Symbolic.Evaluators { … … 42 43 } 43 44 #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 } 45 50 public MultiObjectiveSymbolicVectorRegressionEvaluator() 46 51 : base() { -
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression/3.3/Symbolic/Evaluators/PartialDerivativeEvaluator.cs
r4197 r5275 39 39 public class PartialDerivativeEvaluator : SingleObjectiveSymbolicVectorRegressionEvaluator { 40 40 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 } 42 46 public PartialDerivativeEvaluator() 43 47 : base() { 44 48 } 45 49 public override IDeepCloneable Clone(Cloner cloner) { 50 return new PartialDerivativeEvaluator(this, cloner); 51 } 46 52 public override double Evaluate(SymbolicExpressionTree tree, ISymbolicExpressionTreeInterpreter interpreter, MultiVariateDataAnalysisProblemData problemData, IEnumerable<string> targetVariables, IEnumerable<int> rows, DoubleArray lowerEstimationBound, DoubleArray upperEstimationBound) { 47 53 -
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression/3.3/Symbolic/Evaluators/SingleObjectiveSymbolicVectorRegressionEvaluator.cs
r4401 r5275 32 32 using HeuristicLab.Problems.DataAnalysis.Symbolic; 33 33 using HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression.Symbolic.Interfaces; 34 using HeuristicLab.Common; 34 35 35 36 namespace HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression.Symbolic.Evaluators { … … 42 43 } 43 44 #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 } 45 50 public SingleObjectiveSymbolicVectorRegressionEvaluator() 46 51 : base() { 47 52 Parameters.Add(new LookupParameter<DoubleValue>(QualityParameterName, "The quality of the symbolic vector regression solution.")); 48 53 } 49 50 54 51 55 public override IOperation Apply() { -
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression/3.3/Symbolic/Evaluators/SymbolicRegressionNormalizedMeanSquaredErrorEvaluator.cs
r4194 r5275 29 29 using HeuristicLab.Problems.DataAnalysis.Evaluators; 30 30 using HeuristicLab.Problems.DataAnalysis.Symbolic; 31 using HeuristicLab.Common; 31 32 32 33 namespace HeuristicLab.Problems.DataAnalysis.Regression.Symbolic { … … 34 35 [StorableClass] 35 36 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 } 36 42 public SymbolicRegressionNormalizedMeanSquaredErrorEvaluator() 37 43 : base() { 38 44 } 39 45 public override IDeepCloneable Clone(Cloner cloner) { 46 return new SymbolicRegressionNormalizedMeanSquaredErrorEvaluator(this, cloner); 47 } 40 48 public override double Evaluate(ISymbolicExpressionTreeInterpreter interpreter, SymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, Dataset dataset, string targetVariable, IEnumerable<int> rows) { 41 49 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 31 31 using HeuristicLab.Problems.DataAnalysis.Regression; 32 32 using HeuristicLab.Problems.DataAnalysis.Symbolic; 33 using HeuristicLab.Common; 33 34 34 35 namespace HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression.Symbolic.Evaluators { … … 105 106 #endregion 106 107 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 } 108 113 public SymbolicVectorRegressionEvaluator() 109 114 : base() { … … 118 123 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))); 119 124 } 120 121 125 public static IEnumerable<int> GenerateRowsToEvaluate(int seed, double relativeAmount, int start, int end) { 122 126 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 30 30 using HeuristicLab.Problems.DataAnalysis.Regression.Symbolic; 31 31 using HeuristicLab.Problems.DataAnalysis.Symbolic; 32 using HeuristicLab.Common; 32 33 33 34 namespace HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression.Symbolic.Evaluators { … … 37 38 38 39 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 } 40 45 public SymbolicVectorRegressionNormalizedMseEvaluator() 41 46 : base() { 47 } 48 public override IDeepCloneable Clone(Cloner cloner) { 49 return new SymbolicVectorRegressionNormalizedMseEvaluator(this, cloner); 42 50 } 43 51 -
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression/3.3/Symbolic/Evaluators/SymbolicVectorRegressionScaledMseEvaluator.cs
r4194 r5275 30 30 using HeuristicLab.Problems.DataAnalysis.Regression.Symbolic; 31 31 using HeuristicLab.Problems.DataAnalysis.Symbolic; 32 using HeuristicLab.Common; 32 33 33 34 namespace HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression.Symbolic.Evaluators { … … 48 49 #endregion 49 50 51 [StorableConstructor] 52 protected SymbolicVectorRegressionScaledMseEvaluator(bool deserializing) : base(deserializing) { } 53 protected SymbolicVectorRegressionScaledMseEvaluator(SymbolicVectorRegressionScaledMseEvaluator original, Cloner cloner) 54 : base(original, cloner) { 55 } 50 56 public SymbolicVectorRegressionScaledMseEvaluator() 51 57 : base() { … … 53 59 Parameters.Add(new LookupParameter<DoubleArray>(BetaParameterName, "The beta parameter for linear scaling.")); 54 60 } 55 61 public override IDeepCloneable Clone(Cloner cloner) { 62 return new SymbolicVectorRegressionScaledMseEvaluator(this, cloner); 63 } 56 64 public override double[] Evaluate(SymbolicExpressionTree tree, ISymbolicExpressionTreeInterpreter interpreter, MultiVariateDataAnalysisProblemData problemData, IEnumerable<string> targetVariables, IEnumerable<int> rows, DoubleArray lowerEstimationBound, DoubleArray upperEstimationBound) { 57 65 List<string> targetVariablesList = targetVariables.ToList(); -
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression/3.3/Symbolic/Evaluators/SymbolicVectorRegressionScaledNormalizedMseEvaluator.cs
r4194 r5275 30 30 using HeuristicLab.Problems.DataAnalysis.Regression.Symbolic; 31 31 using HeuristicLab.Problems.DataAnalysis.Symbolic; 32 using HeuristicLab.Common; 32 33 33 34 namespace HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression.Symbolic.Evaluators { … … 48 49 #endregion 49 50 51 [StorableConstructor] 52 protected SymbolicVectorRegressionScaledNormalizedMseEvaluator(bool deserializing) : base(deserializing) { } 53 protected SymbolicVectorRegressionScaledNormalizedMseEvaluator(SymbolicVectorRegressionScaledNormalizedMseEvaluator original, Cloner cloner) 54 : base(original, cloner) { 55 } 50 56 public SymbolicVectorRegressionScaledNormalizedMseEvaluator() 51 57 : base() { … … 53 59 Parameters.Add(new LookupParameter<DoubleArray>(BetaParameterName, "The beta parameter for linear scaling.")); 54 60 } 55 61 public override IDeepCloneable Clone(Cloner cloner) { 62 return new SymbolicVectorRegressionScaledNormalizedMseEvaluator(this, cloner); 63 } 56 64 public override double Evaluate(SymbolicExpressionTree tree, ISymbolicExpressionTreeInterpreter interpreter, MultiVariateDataAnalysisProblemData problemData, IEnumerable<string> targetVariables, IEnumerable<int> rows, DoubleArray lowerEstimationBound, DoubleArray upperEstimationBound) { 57 65 List<string> targetVariablesList = targetVariables.ToList(); -
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression/3.3/Symbolic/MultiObjectiveSymbolicVectorRegressionProblem.cs
r4118 r5275 68 68 [StorableConstructor] 69 69 protected MultiObjectiveSymbolicVectorRegressionProblem(bool deserializing) : base(deserializing) { } 70 protected MultiObjectiveSymbolicVectorRegressionProblem(MultiObjectiveSymbolicVectorRegressionProblem original, Cloner cloner) 71 : base(original, cloner) { 72 Initialize(); 73 } 70 74 public MultiObjectiveSymbolicVectorRegressionProblem() 71 75 : base() { … … 84 88 85 89 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); 89 91 } 90 92 -
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression/3.3/Symbolic/SingleObjectiveSymbolicVectorRegressionProblem.cs
r4087 r5275 75 75 #endregion 76 76 77 [StorableConstructor] 78 private SingleObjectiveSymbolicVectorRegressionProblem(bool deserializing) : base() { } 79 private SingleObjectiveSymbolicVectorRegressionProblem(SingleObjectiveSymbolicVectorRegressionProblem original, Cloner cloner) 80 : base(original, cloner) { 81 Initialize(); 82 } 77 83 public SingleObjectiveSymbolicVectorRegressionProblem() 78 84 : base() { … … 87 93 } 88 94 89 [StorableConstructor]90 private SingleObjectiveSymbolicVectorRegressionProblem(bool deserializing) : base() { }91 95 92 96 [StorableHook(HookType.AfterDeserialization)] 93 private void AfterDeserialization Hook() {97 private void AfterDeserialization() { 94 98 Initialize(); 95 99 } 96 100 97 101 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); 101 103 } 102 103 104 private void RegisterParameterValueEvents() { 104 105 EvaluatorParameter.ValueChanged += new EventHandler(EvaluatorParameter_ValueChanged); -
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression/3.3/Symbolic/SymbolicVectorRegressionGrammar.cs
r4401 r5275 33 33 public class SymbolicVectorRegressionGrammar : MultiVariateExpressionGrammar { 34 34 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 } 36 40 public SymbolicVectorRegressionGrammar(int dimension) 37 41 : base(dimension) { 38 42 Initialize(); 39 43 } 40 41 protected SymbolicVectorRegressionGrammar(SymbolicVectorRegressionGrammar original) : base(original.Dimension) { 42 // fill ??? 44 public override IDeepCloneable Clone(Cloner cloner) { 45 return new SymbolicVectorRegressionGrammar(this, cloner); 43 46 } 44 47 … … 115 118 } 116 119 } 117 118 public override IDeepCloneable Clone(Cloner cloner) {119 var clone = new SymbolicVectorRegressionGrammar(this);120 cloner.RegisterClonedObject(this, clone);121 return clone;122 }123 120 } 124 121 } -
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression/3.3/Symbolic/SymbolicVectorRegressionProblem.cs
r4118 r5275 158 158 [StorableConstructor] 159 159 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 } 160 166 public SymbolicVectorRegressionProblem() 161 167 : base() { … … 184 190 185 191 [StorableHook(HookType.AfterDeserialization)] 186 private void AfterDeserialization Hook() {192 private void AfterDeserialization() { 187 193 // BackwardsCompatibility3.3 188 194 #region Backwards compatible code (remove with 3.4) … … 194 200 195 201 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); 201 203 } 202 204 -
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression/3.3/Symbolic/SymbolicVectorRegressionSolutionLinearScaler.cs
r4112 r5275 29 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 30 using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols; 31 using HeuristicLab.Common; 31 32 32 33 namespace HeuristicLab.Problems.DataAnalysis.MultiVariate.Regression.Symbolic { … … 54 55 get { return (ILookupParameter<DoubleArray>)Parameters[BetaParameterName]; } 55 56 } 56 57 [StorableConstructor] 58 protected SymbolicVectorRegressionSolutionLinearScaler(bool deserializing) : base(deserializing) { } 59 protected SymbolicVectorRegressionSolutionLinearScaler(SymbolicVectorRegressionSolutionLinearScaler original, Cloner cloner) 60 : base(original, cloner) { 61 } 57 62 public SymbolicVectorRegressionSolutionLinearScaler() 58 63 : base() { … … 62 67 Parameters.Add(new LookupParameter<DoubleArray>(BetaParameterName, "Beta parameter for linear transformation.")); 63 68 } 64 69 public override IDeepCloneable Clone(Cloner cloner) { 70 return new SymbolicVectorRegressionSolutionLinearScaler(this, cloner); 71 } 65 72 public override IOperation Apply() { 66 73 SymbolicExpressionTree tree = SymbolicExpressionTreeParameter.ActualValue;
Note: See TracChangeset
for help on using the changeset viewer.