Changeset 8331 for branches/ScatterSearch (trunk integration)/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveProblem.cs
- Timestamp:
- 07/26/12 09:51:13 (12 years ago)
- Location:
- branches/ScatterSearch (trunk integration)
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ScatterSearch (trunk integration)
- Property svn:ignore
-
old new 21 21 protoc.exe 22 22 _ReSharper.HeuristicLab 3.3 Tests 23 Google.ProtocolBuffers-2.4.1.473.dll
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/ScatterSearch (trunk integration)/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveProblem.cs
r8086 r8331 49 49 [StorableConstructor] 50 50 protected SymbolicRegressionSingleObjectiveProblem(bool deserializing) : base(deserializing) { } 51 protected SymbolicRegressionSingleObjectiveProblem(SymbolicRegressionSingleObjectiveProblem original, Cloner cloner) : base(original, cloner) { } 51 protected SymbolicRegressionSingleObjectiveProblem(SymbolicRegressionSingleObjectiveProblem original, Cloner cloner) 52 : base(original, cloner) { 53 RegisterEventHandlers(); 54 } 52 55 public override IDeepCloneable Clone(Cloner cloner) { return new SymbolicRegressionSingleObjectiveProblem(this, cloner); } 53 56 … … 62 65 MaximumSymbolicExpressionTreeLength.Value = InitialMaximumTreeLength; 63 66 64 SymbolicExpressionTreeGrammarParameter.ValueChanged += (o, e) => ConfigureGrammarSymbols(); 65 67 RegisterEventHandlers(); 66 68 ConfigureGrammarSymbols(); 67 69 InitializeOperators(); 68 70 UpdateEstimationLimits(); 71 } 72 73 [StorableHook(HookType.AfterDeserialization)] 74 private void AfterDeserialization() { 75 RegisterEventHandlers(); 76 // compatibility 77 bool changed = false; 78 if (!Operators.OfType<SymbolicRegressionSingleObjectiveTrainingParetoBestSolutionAnalyzer>().Any()) { 79 Operators.Add(new SymbolicRegressionSingleObjectiveTrainingParetoBestSolutionAnalyzer()); 80 changed = true; 81 } 82 if (!Operators.OfType<SymbolicRegressionSingleObjectiveValidationParetoBestSolutionAnalyzer>().Any()) { 83 Operators.Add(new SymbolicRegressionSingleObjectiveValidationParetoBestSolutionAnalyzer()); 84 changed = true; 85 } 86 if (changed) { 87 ParameterizeOperators(); 88 } 89 } 90 91 private void RegisterEventHandlers() { 92 SymbolicExpressionTreeGrammarParameter.ValueChanged += (o, e) => ConfigureGrammarSymbols(); 69 93 } 70 94 … … 85 109 86 110 private void UpdateEstimationLimits() { 87 if (ProblemData.TrainingIndi zes.Any()) {88 var targetValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndi zes).ToList();111 if (ProblemData.TrainingIndices.Any()) { 112 var targetValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndices).ToList(); 89 113 var mean = targetValues.Average(); 90 114 var range = targetValues.Max() - targetValues.Min();
Note: See TracChangeset
for help on using the changeset viewer.