Changeset 5770
- Timestamp:
- 03/21/11 00:19:08 (14 years ago)
- Location:
- branches/DataAnalysis Refactoring
- Files:
-
- 1 added
- 27 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysis Refactoring/HeuristicLab.Data/3.3/StringConvertibleValueTuple.cs
r5759 r5770 47 47 48 48 [StorableConstructor] 49 protected StringConvertibleValueTuple(bool deserializing) : base(deserializing) { } 49 protected StringConvertibleValueTuple(bool deserializing) 50 : base(deserializing) { 51 RegisterEventHandler(); 52 } 50 53 protected StringConvertibleValueTuple(StringConvertibleValueTuple<T, U> original, Cloner cloner) 51 54 : base(original, cloner) { … … 53 56 U item2 = (U)cloner.Clone(original.values.Item2); 54 57 values = Tuple.Create<T, U>(item1, item2); 58 RegisterEventHandler(); 55 59 } 56 60 -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveMeanSquaredErrorTreeSizeEvaluator.cs
r5759 r5770 46 46 public override IOperation Apply() { 47 47 IEnumerable<int> rows = GenerateRowsToEvaluate(); 48 double[] qualities = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, SymbolicExpressionTreeParameter.ActualValue, LowerEstimationLimitParameter.ActualValue.Value, UpperEstimationLimitParameter.ActualValue.Value, ProblemDataParameter.ActualValue, rows);48 double[] qualities = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, SymbolicExpressionTreeParameter.ActualValue, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, ProblemDataParameter.ActualValue, rows); 49 49 QualitiesParameter.ActualValue = new DoubleArray(qualities); 50 50 return base.Apply(); … … 61 61 public override double[] Evaluate(IExecutionContext context, ISymbolicExpressionTree tree, IClassificationProblemData problemData, IEnumerable<int> rows) { 62 62 SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = context; 63 LowerEstimationLimitParameter.ExecutionContext = context; 64 UpperEstimationLimitParameter.ExecutionContext = context; 63 EstimationLimitsParameter.ExecutionContext = context; 65 64 66 double[] quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree, LowerEstimationLimitParameter.ActualValue.Value, UpperEstimationLimitParameter.ActualValue.Value, problemData, rows);65 double[] quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, problemData, rows); 67 66 68 67 SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = null; 69 LowerEstimationLimitParameter.ExecutionContext = null; 70 UpperEstimationLimitParameter.ExecutionContext = null; 68 EstimationLimitsParameter.ExecutionContext = null; 71 69 72 70 return quality; -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectivePearsonRSquaredTreeSizeEvaluator.cs
r5759 r5770 26 26 public override IOperation Apply() { 27 27 IEnumerable<int> rows = GenerateRowsToEvaluate(); 28 double[] qualities = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, SymbolicExpressionTreeParameter.ActualValue, LowerEstimationLimitParameter.ActualValue.Value, UpperEstimationLimitParameter.ActualValue.Value, ProblemDataParameter.ActualValue, rows);28 double[] qualities = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, SymbolicExpressionTreeParameter.ActualValue, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, ProblemDataParameter.ActualValue, rows); 29 29 QualitiesParameter.ActualValue = new DoubleArray(qualities); 30 30 return base.Apply(); … … 46 46 public override double[] Evaluate(IExecutionContext context, ISymbolicExpressionTree tree, IClassificationProblemData problemData, IEnumerable<int> rows) { 47 47 SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = context; 48 LowerEstimationLimitParameter.ExecutionContext = context; 49 UpperEstimationLimitParameter.ExecutionContext = context; 48 EstimationLimitsParameter.ExecutionContext = context; 50 49 51 double[] quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree, LowerEstimationLimitParameter.ActualValue.Value, UpperEstimationLimitParameter.ActualValue.Value, problemData, rows);50 double[] quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, problemData, rows); 52 51 53 52 SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = null; 54 LowerEstimationLimitParameter.ExecutionContext = null; 55 UpperEstimationLimitParameter.ExecutionContext = null; 53 EstimationLimitsParameter.ExecutionContext = null; 56 54 57 55 return quality; -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveProblem.cs
r5759 r5770 34 34 private const int InitialMaximumTreeDepth = 8; 35 35 private const int InitialMaximumTreeLength = 25; 36 private const string LowerEstimationLimitParameterName = "LowerEstimationLimit"; 37 private const string UpperEstimationLimitParameterName = "UpperEstimationLimit"; 38 private const string LowerEstimationLimitParameterDescription = "The lower limit for the estimated value that can be returned by the symbolic classification model."; 39 private const string UpperEstimationLimitParameterDescription = "The upper limit for the estimated value that can be returned by the symbolic classification model."; 36 private const string EstimationLimitsParameterName = "EstimationLimits"; 37 private const string EstimationLimitsParameterDescription = "The lower and upper limit for the estimated value that can be returned by the symbolic classification model."; 40 38 41 39 #region parameter properties 42 public IFixedValueParameter<DoubleValue> LowerEstimationLimitParameter { 43 get { return (IFixedValueParameter<DoubleValue>)Parameters[LowerEstimationLimitParameterName]; } 44 } 45 public IFixedValueParameter<DoubleValue> UpperEstimationLimitParameter { 46 get { return (IFixedValueParameter<DoubleValue>)Parameters[UpperEstimationLimitParameterName]; } 40 public IFixedValueParameter<DoubleLimit> EstimationLimitsParameter { 41 get { return (IFixedValueParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; } 47 42 } 48 43 #endregion 49 44 #region properties 50 public DoubleValue LowerEstimationLimit { 51 get { return LowerEstimationLimitParameter.Value; } 52 } 53 public DoubleValue UpperEstimationLimit { 54 get { return UpperEstimationLimitParameter.Value; } 45 public DoubleLimit EstimationLimits { 46 get { return EstimationLimitsParameter.Value; } 55 47 } 56 48 #endregion … … 62 54 public SymbolicClassificationMultiObjectiveProblem() 63 55 : base(new ClassificationProblemData(), new SymbolicClassificationMultiObjectiveMeanSquaredErrorTreeSizeEvaluator(), new SymbolicDataAnalysisExpressionTreeCreator()) { 64 Parameters.Add(new FixedValueParameter<DoubleValue>(LowerEstimationLimitParameterName, LowerEstimationLimitParameterDescription, new DoubleValue())); 65 Parameters.Add(new FixedValueParameter<DoubleValue>(UpperEstimationLimitParameterName, UpperEstimationLimitParameterDescription, new DoubleValue())); 56 Parameters.Add(new FixedValueParameter<DoubleLimit>(EstimationLimitsParameterName, EstimationLimitsParameterDescription, new DoubleLimit())); 66 57 67 58 Maximization = new BoolArray(new bool[] { false, false }); … … 84 75 var mean = targetValues.Average(); 85 76 var range = targetValues.Max() - targetValues.Min(); 86 UpperEstimationLimit.Value= mean + PunishmentFactor * range;87 LowerEstimationLimit.Value= mean - PunishmentFactor * range;77 EstimationLimits.Upper = mean + PunishmentFactor * range; 78 EstimationLimits.Lower = mean - PunishmentFactor * range; 88 79 } 89 80 } … … 96 87 protected new void ParameterizeOperators() { 97 88 base.ParameterizeOperators(); 98 var operators = Parameters.OfType<IValueParameter>().Select(p => p.Value).OfType<IOperator>().Union(Operators); 99 foreach (var op in operators.OfType<ISymbolicDataAnalysisBoundedOperator>()) { 100 op.LowerEstimationLimitParameter.ActualName = LowerEstimationLimitParameterName; 101 op.UpperEstimationLimitParameter.ActualName = UpperEstimationLimitParameterName; 89 if (Parameters.ContainsKey(EstimationLimitsParameterName)) { 90 var operators = Parameters.OfType<IValueParameter>().Select(p => p.Value).OfType<IOperator>().Union(Operators); 91 foreach (var op in operators.OfType<ISymbolicDataAnalysisBoundedOperator>()) { 92 op.EstimationLimitsParameter.ActualName = EstimationLimitsParameterName; 93 } 102 94 } 103 95 } -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveTrainingBestSolutionAnalyzer.cs
r5747 r5770 20 20 #endregion 21 21 22 using System.Collections.Generic;23 using System.Linq;24 22 using HeuristicLab.Common; 25 23 using HeuristicLab.Core; 26 24 using HeuristicLab.Data; 27 25 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 28 using HeuristicLab.Operators;29 using HeuristicLab.Optimization;30 26 using HeuristicLab.Parameters; 31 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 41 37 private const string ProblemDataParameterName = "ProblemData"; 42 38 private const string SymbolicDataAnalysisTreeInterpreterParameterName = "SymbolicDataAnalysisTreeInterpreter"; 43 private const string UpperEstimationLimitParameterName = "UpperEstimationLimit"; 44 private const string LowerEstimationLimitParameterName = "LowerEstimationLimit"; 39 private const string EstimationLimitsParameterName = "EstimationLimits"; 45 40 private const string ApplyLinearScalingParameterName = "ApplyLinearScaling"; 41 46 42 #region parameter properties 47 43 public ILookupParameter<IClassificationProblemData> ProblemDataParameter { … … 51 47 get { return (ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[SymbolicDataAnalysisTreeInterpreterParameterName]; } 52 48 } 53 public IValueLookupParameter<DoubleValue> UpperEstimationLimitParameter { 54 get { return (IValueLookupParameter<DoubleValue>)Parameters[UpperEstimationLimitParameterName]; } 55 } 56 57 public IValueLookupParameter<DoubleValue> LowerEstimationLimitParameter { 58 get { return (IValueLookupParameter<DoubleValue>)Parameters[LowerEstimationLimitParameterName]; } 49 public IValueLookupParameter<DoubleLimit> EstimationLimitsParameter { 50 get { return (IValueLookupParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; } 59 51 } 60 52 public IValueParameter<BoolValue> ApplyLinearScalingParameter { … … 62 54 } 63 55 #endregion 56 64 57 #region properties 65 public IClassificationProblemData ProblemData {66 get { return ProblemDataParameter.ActualValue; }67 }68 public ISymbolicDataAnalysisExpressionTreeInterpreter SymbolicDataAnalysisTreeInterpreter {69 get { return SymbolicDataAnalysisTreeInterpreterParameter.ActualValue; }70 }71 public DoubleValue UpperEstimationLimit {72 get { return UpperEstimationLimitParameter.ActualValue; }73 }74 public DoubleValue LowerEstimationLimit {75 get { return LowerEstimationLimitParameter.ActualValue; }76 }77 58 public BoolValue ApplyLinearScaling { 78 59 get { return ApplyLinearScalingParameter.Value; } … … 87 68 Parameters.Add(new LookupParameter<IClassificationProblemData>(ProblemDataParameterName, "The problem data for the symbolic classification solution.")); 88 69 Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(SymbolicDataAnalysisTreeInterpreterParameterName, "The symbolic data analysis tree interpreter for the symbolic expression tree.")); 89 Parameters.Add(new ValueLookupParameter<DoubleValue>(UpperEstimationLimitParameterName, "The upper limit for the estimated values produced by the symbolic classification model.")); 90 Parameters.Add(new ValueLookupParameter<DoubleValue>(LowerEstimationLimitParameterName, "The lower limit for the estimated values produced by the symbolic classification model.")); 70 Parameters.Add(new ValueLookupParameter<DoubleLimit>(EstimationLimitsParameterName, "The lower and upper limit for the estimated values produced by the symbolic classification model.")); 91 71 Parameters.Add(new ValueParameter<BoolValue>(ApplyLinearScalingParameterName, "Flag that indicates if the produced symbolic classification solution should be linearly scaled.", new BoolValue(false))); 92 72 } … … 96 76 97 77 protected override ISymbolicClassificationSolution CreateSolution(ISymbolicExpressionTree bestTree, double[] bestQuality) { 98 var model = new SymbolicDiscriminantFunctionClassificationModel(bestTree, SymbolicDataAnalysisTreeInterpreter , LowerEstimationLimit.Value, UpperEstimationLimit.Value);99 var solution = new SymbolicDiscriminantFunctionClassificationSolution(model, ProblemData );78 var model = new SymbolicDiscriminantFunctionClassificationModel(bestTree, SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper); 79 var solution = new SymbolicDiscriminantFunctionClassificationSolution(model, ProblemDataParameter.ActualValue); 100 80 if (ApplyLinearScaling.Value) { 101 81 solution.ScaleModel(); -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveValidationBestSolutionAnalyzer.cs
r5759 r5770 35 35 public sealed class SymbolicClassificationMultiObjectiveValidationBestSolutionAnalyzer : SymbolicDataAnalysisMultiObjectiveValidationBestSolutionAnalyzer<ISymbolicClassificationSolution, ISymbolicClassificationMultiObjectiveEvaluator, IClassificationProblemData>, 36 36 ISymbolicDataAnalysisBoundedOperator { 37 private const string UpperEstimationLimitParameterName = "UpperEstimationLimit"; 38 private const string LowerEstimationLimitParameterName = "LowerEstimationLimit"; 37 private const string EstimationLimitsParameterName = "EstimationLimits"; 39 38 private const string ApplyLinearScalingParameterName = "ApplyLinearScaling"; 40 39 41 40 #region parameter properties 42 public IValueLookupParameter<DoubleValue> UpperEstimationLimitParameter { 43 get { return (IValueLookupParameter<DoubleValue>)Parameters[UpperEstimationLimitParameterName]; } 44 } 45 public IValueLookupParameter<DoubleValue> LowerEstimationLimitParameter { 46 get { return (IValueLookupParameter<DoubleValue>)Parameters[LowerEstimationLimitParameterName]; } 41 public IValueLookupParameter<DoubleLimit> EstimationLimitsParameter { 42 get { return (IValueLookupParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; } 47 43 } 48 44 public IValueParameter<BoolValue> ApplyLinearScalingParameter { … … 61 57 public SymbolicClassificationMultiObjectiveValidationBestSolutionAnalyzer() 62 58 : base() { 63 Parameters.Add(new ValueLookupParameter<DoubleValue>(UpperEstimationLimitParameterName, "The upper limit for the estimated values produced by the symbolic classification model.")); 64 Parameters.Add(new ValueLookupParameter<DoubleValue>(LowerEstimationLimitParameterName, "The lower limit for the estimated values produced by the symbolic classification model.")); 59 Parameters.Add(new ValueLookupParameter<DoubleLimit>(EstimationLimitsParameterName, "The loewr and upper limit for the estimated values produced by the symbolic classification model.")); 65 60 Parameters.Add(new ValueParameter<BoolValue>(ApplyLinearScalingParameterName, "Flag that indicates if the produced symbolic classification solution should be linearly scaled.", new BoolValue(false))); 66 61 } … … 70 65 71 66 protected override ISymbolicClassificationSolution CreateSolution(ISymbolicExpressionTree bestTree, double[] bestQualities) { 72 var model = new SymbolicDiscriminantFunctionClassificationModel(bestTree, SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, LowerEstimationLimitParameter.ActualValue.Value, UpperEstimationLimitParameter.ActualValue.Value);67 var model = new SymbolicDiscriminantFunctionClassificationModel(bestTree, SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper); 73 68 var solution = new SymbolicDiscriminantFunctionClassificationSolution(model, ProblemDataParameter.ActualValue); 74 69 if (ApplyLinearScaling.Value) { -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveBoundedMeanSquaredErrorEvaluator.cs
r5759 r5770 47 47 public override IOperation Apply() { 48 48 IEnumerable<int> rows = GenerateRowsToEvaluate(); 49 double quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, SymbolicExpressionTreeParameter.ActualValue, LowerEstimationLimitParameter.ActualValue.Value, UpperEstimationLimitParameter.ActualValue.Value, ProblemDataParameter.ActualValue, rows);49 double quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, SymbolicExpressionTreeParameter.ActualValue, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, ProblemDataParameter.ActualValue, rows); 50 50 QualityParameter.ActualValue = new DoubleValue(quality); 51 51 return base.Apply(); … … 88 88 89 89 public override double Evaluate(IExecutionContext context, ISymbolicExpressionTree tree, IClassificationProblemData problemData, IEnumerable<int> rows) { 90 return Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree, LowerEstimationLimitParameter.ActualValue.Value, UpperEstimationLimitParameter.ActualValue.Value, problemData, rows);90 return Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, problemData, rows); 91 91 } 92 92 } -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveMeanSquaredErrorEvaluator.cs
r5759 r5770 46 46 public override IOperation Apply() { 47 47 IEnumerable<int> rows = GenerateRowsToEvaluate(); 48 double quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, SymbolicExpressionTreeParameter.ActualValue, LowerEstimationLimitParameter.ActualValue.Value, UpperEstimationLimitParameter.ActualValue.Value, ProblemDataParameter.ActualValue, rows);48 double quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, SymbolicExpressionTreeParameter.ActualValue, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, ProblemDataParameter.ActualValue, rows); 49 49 QualityParameter.ActualValue = new DoubleValue(quality); 50 50 return base.Apply(); … … 60 60 public override double Evaluate(IExecutionContext context, ISymbolicExpressionTree tree, IClassificationProblemData problemData, IEnumerable<int> rows) { 61 61 SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = context; 62 LowerEstimationLimitParameter.ExecutionContext = context; 63 UpperEstimationLimitParameter.ExecutionContext = context; 62 EstimationLimitsParameter.ExecutionContext = context; 64 63 65 double mse = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree, LowerEstimationLimitParameter.ActualValue.Value, UpperEstimationLimitParameter.ActualValue.Value, problemData, rows);64 double mse = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, problemData, rows); 66 65 67 66 SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = null; 68 LowerEstimationLimitParameter.ExecutionContext = null; 69 UpperEstimationLimitParameter.ExecutionContext = null; 67 EstimationLimitsParameter.ExecutionContext = null; 70 68 71 69 return mse; -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectivePearsonRSquaredEvaluator.cs
r5759 r5770 47 47 public override IOperation Apply() { 48 48 IEnumerable<int> rows = GenerateRowsToEvaluate(); 49 double quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, SymbolicExpressionTreeParameter.ActualValue, LowerEstimationLimitParameter.ActualValue.Value, UpperEstimationLimitParameter.ActualValue.Value, ProblemDataParameter.ActualValue, rows);49 double quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, SymbolicExpressionTreeParameter.ActualValue, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, ProblemDataParameter.ActualValue, rows); 50 50 QualityParameter.ActualValue = new DoubleValue(quality); 51 51 return base.Apply(); … … 66 66 public override double Evaluate(IExecutionContext context, ISymbolicExpressionTree tree, IClassificationProblemData problemData, IEnumerable<int> rows) { 67 67 SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = context; 68 LowerEstimationLimitParameter.ExecutionContext = context; 69 UpperEstimationLimitParameter.ExecutionContext = context; 68 EstimationLimitsParameter.ExecutionContext = context; 70 69 71 double r2 = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree, LowerEstimationLimitParameter.ActualValue.Value, UpperEstimationLimitParameter.ActualValue.Value, problemData, rows);70 double r2 = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, problemData, rows); 72 71 73 72 SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = null; 74 LowerEstimationLimitParameter.ExecutionContext = null; 75 UpperEstimationLimitParameter.ExecutionContext = null; 73 EstimationLimitsParameter.ExecutionContext = null; 76 74 77 75 return r2; -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveProblem.cs
r5759 r5770 22 22 using HeuristicLab.Common; 23 23 using HeuristicLab.Core; 24 using HeuristicLab.Data;25 24 using HeuristicLab.Parameters; 26 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 34 33 private const int InitialMaximumTreeDepth = 8; 35 34 private const int InitialMaximumTreeLength = 25; 36 private const string LowerEstimationLimitParameterName = "LowerEstimationLimit"; 37 private const string UpperEstimationLimitParameterName = "UpperEstimationLimit"; 38 private const string LowerEstimationLimitParameterDescription = "The lower limit for the estimated value that can be returned by the symbolic classification model."; 39 private const string UpperEstimationLimitParameterDescription = "The upper limit for the estimated value that can be returned by the symbolic classification model."; 35 private const string EstimationLimitsParameterName = "EstimationLimits"; 36 private const string EstimationLimitsParameterDescription = "The lower and upper limit for the estimated value that can be returned by the symbolic classification model."; 40 37 41 38 #region parameter properties 42 public IFixedValueParameter<DoubleValue> LowerEstimationLimitParameter { 43 get { return (IFixedValueParameter<DoubleValue>)Parameters[LowerEstimationLimitParameterName]; } 44 } 45 public IFixedValueParameter<DoubleValue> UpperEstimationLimitParameter { 46 get { return (IFixedValueParameter<DoubleValue>)Parameters[UpperEstimationLimitParameterName]; } 39 public IFixedValueParameter<DoubleLimit> EstimationLimitsParameter { 40 get { return (IFixedValueParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; } 47 41 } 48 42 #endregion 49 43 #region properties 50 public DoubleValue LowerEstimationLimit { 51 get { return LowerEstimationLimitParameter.Value; } 52 } 53 public DoubleValue UpperEstimationLimit { 54 get { return UpperEstimationLimitParameter.Value; } 44 public DoubleLimit EstimationLimits { 45 get { return EstimationLimitsParameter.Value; } 55 46 } 56 47 #endregion … … 62 53 public SymbolicClassificationSingleObjectiveProblem() 63 54 : base(new ClassificationProblemData(), new SymbolicClassificationSingleObjectiveMeanSquaredErrorEvaluator(), new SymbolicDataAnalysisExpressionTreeCreator()) { 64 Parameters.Add(new FixedValueParameter<DoubleValue>(LowerEstimationLimitParameterName, LowerEstimationLimitParameterDescription, new DoubleValue())); 65 Parameters.Add(new FixedValueParameter<DoubleValue>(UpperEstimationLimitParameterName, UpperEstimationLimitParameterDescription, new DoubleValue())); 55 Parameters.Add(new FixedValueParameter<DoubleLimit>(EstimationLimitsParameterName, EstimationLimitsParameterDescription, new DoubleLimit())); 66 56 67 57 MaximumSymbolicExpressionTreeDepth.Value = InitialMaximumTreeDepth; … … 84 74 var mean = targetValues.Average(); 85 75 var range = targetValues.Max() - targetValues.Min(); 86 UpperEstimationLimit.Value= mean + PunishmentFactor * range;87 LowerEstimationLimit.Value= mean - PunishmentFactor * range;76 EstimationLimits.Upper = mean + PunishmentFactor * range; 77 EstimationLimits.Lower = mean - PunishmentFactor * range; 88 78 } 89 79 } … … 96 86 protected override void ParameterizeOperators() { 97 87 base.ParameterizeOperators(); 98 var operators = Parameters.OfType<IValueParameter>().Select(p => p.Value).OfType<IOperator>().Union(Operators); 99 foreach (var op in operators.OfType<ISymbolicDataAnalysisBoundedOperator>()) { 100 op.LowerEstimationLimitParameter.ActualName = LowerEstimationLimitParameterName; 101 op.UpperEstimationLimitParameter.ActualName = UpperEstimationLimitParameterName; 88 if (Parameters.ContainsKey(EstimationLimitsParameterName)) { 89 var operators = Parameters.OfType<IValueParameter>().Select(p => p.Value).OfType<IOperator>().Union(Operators); 90 foreach (var op in operators.OfType<ISymbolicDataAnalysisBoundedOperator>()) { 91 op.EstimationLimitsParameter.ActualName = EstimationLimitsParameter.Name; 92 } 102 93 } 103 94 } -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveTrainingBestSolutionAnalyzer.cs
r5736 r5770 20 20 #endregion 21 21 22 using System.Collections.Generic;23 using System.Linq;24 22 using HeuristicLab.Common; 25 23 using HeuristicLab.Core; 26 24 using HeuristicLab.Data; 27 25 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 28 using HeuristicLab.Operators;29 using HeuristicLab.Optimization;30 26 using HeuristicLab.Parameters; 31 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 41 37 private const string ProblemDataParameterName = "ProblemData"; 42 38 private const string SymbolicDataAnalysisTreeInterpreterParameterName = "SymbolicDataAnalysisTreeInterpreter"; 43 private const string UpperEstimationLimitParameterName = "UpperEstimationLimit"; 44 private const string LowerEstimationLimitParameterName = "LowerEstimationLimit"; 39 private const string EstimationLimitsParameterName = "UpperEstimationLimit"; 45 40 private const string ApplyLinearScalingParameterName = "ApplyLinearScaling"; 46 41 #region parameter properties … … 51 46 get { return (ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[SymbolicDataAnalysisTreeInterpreterParameterName]; } 52 47 } 53 public IValueLookupParameter<DoubleValue> UpperEstimationLimitParameter { 54 get { return (IValueLookupParameter<DoubleValue>)Parameters[UpperEstimationLimitParameterName]; } 55 } 56 57 public IValueLookupParameter<DoubleValue> LowerEstimationLimitParameter { 58 get { return (IValueLookupParameter<DoubleValue>)Parameters[LowerEstimationLimitParameterName]; } 48 public IValueLookupParameter<DoubleLimit> EstimationLimitsParameter { 49 get { return (IValueLookupParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; } 59 50 } 60 51 public IValueParameter<BoolValue> ApplyLinearScalingParameter { … … 63 54 #endregion 64 55 #region properties 65 public IClassificationProblemData ProblemData {66 get { return ProblemDataParameter.ActualValue; }67 }68 public ISymbolicDataAnalysisExpressionTreeInterpreter SymbolicDataAnalysisTreeInterpreter {69 get { return SymbolicDataAnalysisTreeInterpreterParameter.ActualValue; }70 }71 public DoubleValue UpperEstimationLimit {72 get { return UpperEstimationLimitParameter.ActualValue; }73 }74 public DoubleValue LowerEstimationLimit {75 get { return LowerEstimationLimitParameter.ActualValue; }76 }77 56 public BoolValue ApplyLinearScaling { 78 57 get { return ApplyLinearScalingParameter.Value; } … … 87 66 Parameters.Add(new LookupParameter<IClassificationProblemData>(ProblemDataParameterName, "The problem data for the symbolic classification solution.")); 88 67 Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(SymbolicDataAnalysisTreeInterpreterParameterName, "The symbolic data analysis tree interpreter for the symbolic expression tree.")); 89 Parameters.Add(new ValueLookupParameter<DoubleValue>(UpperEstimationLimitParameterName, "The upper limit for the estimated values produced by the symbolic classification model.")); 90 Parameters.Add(new ValueLookupParameter<DoubleValue>(LowerEstimationLimitParameterName, "The lower limit for the estimated values produced by the symbolic classification model.")); 68 Parameters.Add(new ValueLookupParameter<DoubleLimit>(EstimationLimitsParameterName, "The lower and upper limit for the estimated values produced by the symbolic classification model.")); 91 69 Parameters.Add(new ValueParameter<BoolValue>(ApplyLinearScalingParameterName, "Flag that indicates if the produced symbolic classification solution should be linearly scaled.", new BoolValue(false))); 92 70 } … … 96 74 97 75 protected override ISymbolicClassificationSolution CreateSolution(ISymbolicExpressionTree bestTree, double bestQuality) { 98 var model = new SymbolicDiscriminantFunctionClassificationModel(bestTree, SymbolicDataAnalysisTreeInterpreter , LowerEstimationLimit.Value, UpperEstimationLimit.Value);99 var solution = new SymbolicDiscriminantFunctionClassificationSolution(model, ProblemData );76 var model = new SymbolicDiscriminantFunctionClassificationModel(bestTree, SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper); 77 var solution = new SymbolicDiscriminantFunctionClassificationSolution(model, ProblemDataParameter.ActualValue); 100 78 if (ApplyLinearScaling.Value) { 101 79 solution.ScaleModel(); -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveValidationBestSolutionAnalyzer.cs
r5759 r5770 35 35 public sealed class SymbolicClassificationSingleObjectiveValidationBestSolutionAnalyzer : SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer<ISymbolicClassificationSolution, ISymbolicClassificationSingleObjectiveEvaluator, IClassificationProblemData>, 36 36 ISymbolicDataAnalysisBoundedOperator { 37 private const string UpperEstimationLimitParameterName = "UpperEstimationLimit"; 38 private const string LowerEstimationLimitParameterName = "LowerEstimationLimit"; 37 private const string EstimationLimitsParameterName = "EstimationLimits"; 39 38 private const string ApplyLinearScalingParameterName = "ApplyLinearScaling"; 40 39 41 40 #region parameter properties 42 public IValueLookupParameter<DoubleValue> UpperEstimationLimitParameter { 43 get { return (IValueLookupParameter<DoubleValue>)Parameters[UpperEstimationLimitParameterName]; } 44 } 45 public IValueLookupParameter<DoubleValue> LowerEstimationLimitParameter { 46 get { return (IValueLookupParameter<DoubleValue>)Parameters[LowerEstimationLimitParameterName]; } 41 public IValueLookupParameter<DoubleLimit> EstimationLimitsParameter { 42 get { return (IValueLookupParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; } 47 43 } 48 44 public IValueParameter<BoolValue> ApplyLinearScalingParameter { … … 61 57 public SymbolicClassificationSingleObjectiveValidationBestSolutionAnalyzer() 62 58 : base() { 63 Parameters.Add(new ValueLookupParameter<DoubleValue>(UpperEstimationLimitParameterName, "The upper limit for the estimated values produced by the symbolic classification model.")); 64 Parameters.Add(new ValueLookupParameter<DoubleValue>(LowerEstimationLimitParameterName, "The lower limit for the estimated values produced by the symbolic classification model.")); 59 Parameters.Add(new ValueLookupParameter<DoubleLimit>(EstimationLimitsParameterName, "The lower and upper limit for the estimated values produced by the symbolic classification model.")); 65 60 Parameters.Add(new ValueParameter<BoolValue>(ApplyLinearScalingParameterName, "Flag that indicates if the produced symbolic classification solution should be linearly scaled.", new BoolValue(false))); 66 61 } … … 70 65 71 66 protected override ISymbolicClassificationSolution CreateSolution(ISymbolicExpressionTree bestTree, double bestQuality) { 72 var model = new SymbolicDiscriminantFunctionClassificationModel(bestTree, SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, LowerEstimationLimitParameter.ActualValue.Value, UpperEstimationLimitParameter.ActualValue.Value);67 var model = new SymbolicDiscriminantFunctionClassificationModel(bestTree, SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper); 73 68 var solution = new SymbolicDiscriminantFunctionClassificationSolution(model, ProblemDataParameter.ActualValue); 74 69 if (ApplyLinearScaling.Value) { -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveMeanSquaredErrorTreeSizeEvaluator.cs
r5759 r5770 46 46 public override Core.IOperation Apply() { 47 47 IEnumerable<int> rows = GenerateRowsToEvaluate(); 48 double[] qualities = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, SymbolicExpressionTreeParameter.ActualValue, LowerEstimationLimitParameter.ActualValue.Value, UpperEstimationLimitParameter.ActualValue.Value, ProblemDataParameter.ActualValue, rows);48 double[] qualities = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, SymbolicExpressionTreeParameter.ActualValue, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, ProblemDataParameter.ActualValue, rows); 49 49 QualitiesParameter.ActualValue = new DoubleArray(qualities); 50 50 return base.Apply(); … … 61 61 public override double[] Evaluate(IExecutionContext context, ISymbolicExpressionTree tree, IRegressionProblemData problemData, IEnumerable<int> rows) { 62 62 SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = context; 63 LowerEstimationLimitParameter.ExecutionContext = context; 64 UpperEstimationLimitParameter.ExecutionContext = context; 63 EstimationLimitsParameter.ExecutionContext = context; 65 64 66 double[] quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree, LowerEstimationLimitParameter.ActualValue.Value, UpperEstimationLimitParameter.ActualValue.Value, problemData, rows);65 double[] quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, problemData, rows); 67 66 68 67 SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = null; 69 LowerEstimationLimitParameter.ExecutionContext = null; 70 UpperEstimationLimitParameter.ExecutionContext = null; 68 EstimationLimitsParameter.ExecutionContext = null; 71 69 72 70 return quality; -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectivePearsonRSquaredTreeSizeEvaluator.cs
r5759 r5770 47 47 public override IOperation Apply() { 48 48 IEnumerable<int> rows = GenerateRowsToEvaluate(); 49 double[] qualities = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, SymbolicExpressionTreeParameter.ActualValue, LowerEstimationLimitParameter.ActualValue.Value, UpperEstimationLimitParameter.ActualValue.Value, ProblemDataParameter.ActualValue, rows);49 double[] qualities = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, SymbolicExpressionTreeParameter.ActualValue, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, ProblemDataParameter.ActualValue, rows); 50 50 QualitiesParameter.ActualValue = new DoubleArray(qualities); 51 51 return base.Apply(); … … 67 67 public override double[] Evaluate(IExecutionContext context, ISymbolicExpressionTree tree, IRegressionProblemData problemData, IEnumerable<int> rows) { 68 68 SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = context; 69 LowerEstimationLimitParameter.ExecutionContext = context; 70 UpperEstimationLimitParameter.ExecutionContext = context; 69 EstimationLimitsParameter.ExecutionContext = context; 71 70 72 double[] quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree, LowerEstimationLimitParameter.ActualValue.Value, UpperEstimationLimitParameter.ActualValue.Value, problemData, rows);71 double[] quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, problemData, rows); 73 72 74 73 SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = null; 75 LowerEstimationLimitParameter.ExecutionContext = null; 76 UpperEstimationLimitParameter.ExecutionContext = null; 74 EstimationLimitsParameter.ExecutionContext = null; 77 75 78 76 return quality; -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveProblem.cs
r5759 r5770 35 35 private const int InitialMaximumTreeDepth = 8; 36 36 private const int InitialMaximumTreeLength = 25; 37 private const string LowerEstimationLimitParameterName = "LowerEstimationLimit"; 38 private const string UpperEstimationLimitParameterName = "UpperEstimationLimit"; 39 private const string LowerEstimationLimitParameterDescription = "The lower limit for the estimated value that can be returned by the symbolic regression model."; 40 private const string UpperEstimationLimitParameterDescription = "The upper limit for the estimated value that can be returned by the symbolic regression model."; 37 private const string EstimationLimitsParameterName = "EstimationLimits"; 38 private const string EstimationLimitsParameterDescription = "The lower and upper limit for the estimated value that can be returned by the symbolic regression model."; 41 39 42 40 #region parameter properties 43 public IFixedValueParameter<DoubleValue> LowerEstimationLimitParameter { 44 get { return (IFixedValueParameter<DoubleValue>)Parameters[LowerEstimationLimitParameterName]; } 45 } 46 public IFixedValueParameter<DoubleValue> UpperEstimationLimitParameter { 47 get { return (IFixedValueParameter<DoubleValue>)Parameters[UpperEstimationLimitParameterName]; } 41 public IFixedValueParameter<DoubleLimit> EstimationLimitsParameter { 42 get { return (IFixedValueParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; } 48 43 } 49 44 #endregion 45 50 46 #region properties 51 public Double Value LowerEstimationLimit{52 get { return LowerEstimationLimitParameter.Value; }47 public DoubleLimit EstimationLimits { 48 get { return EstimationLimitsParameter.Value; } 53 49 } 54 public DoubleValue UpperEstimationLimit { 55 get { return UpperEstimationLimitParameter.Value; } 56 } 50 57 51 #endregion 52 58 53 [StorableConstructor] 59 54 protected SymbolicRegressionMultiObjectiveProblem(bool deserializing) : base(deserializing) { } … … 63 58 public SymbolicRegressionMultiObjectiveProblem() 64 59 : base(new RegressionProblemData(), new SymbolicRegressionMultiObjectivePearsonRSquaredTreeSizeEvaluator(), new SymbolicDataAnalysisExpressionTreeCreator()) { 65 Parameters.Add(new FixedValueParameter<DoubleValue>(LowerEstimationLimitParameterName, LowerEstimationLimitParameterDescription, new DoubleValue())); 66 Parameters.Add(new FixedValueParameter<DoubleValue>(UpperEstimationLimitParameterName, UpperEstimationLimitParameterDescription, new DoubleValue())); 60 Parameters.Add(new FixedValueParameter<DoubleLimit>(EstimationLimitsParameterName, EstimationLimitsParameterDescription, new DoubleLimit())); 67 61 68 62 Maximization = new BoolArray(new bool[] { true, false }); … … 85 79 var mean = targetValues.Average(); 86 80 var range = targetValues.Max() - targetValues.Min(); 87 UpperEstimationLimit.Value= mean + PunishmentFactor * range;88 LowerEstimationLimit.Value= mean - PunishmentFactor * range;81 EstimationLimits.Upper = mean + PunishmentFactor * range; 82 EstimationLimits.Lower = mean - PunishmentFactor * range; 89 83 } 90 84 } … … 97 91 protected override void ParameterizeOperators() { 98 92 base.ParameterizeOperators(); 99 var operators = Parameters.OfType<IValueParameter>().Select(p => p.Value).OfType<IOperator>().Union(Operators); 100 foreach (var op in operators.OfType<ISymbolicDataAnalysisBoundedOperator>()) { 101 op.LowerEstimationLimitParameter.ActualName = LowerEstimationLimitParameterName; 102 op.UpperEstimationLimitParameter.ActualName = UpperEstimationLimitParameterName; 93 if (Parameters.ContainsKey(EstimationLimitsParameterName)) { 94 var operators = Parameters.OfType<IValueParameter>().Select(p => p.Value).OfType<IOperator>().Union(Operators); 95 foreach (var op in operators.OfType<ISymbolicDataAnalysisBoundedOperator>()) { 96 op.EstimationLimitsParameter.ActualName = EstimationLimitsParameter.Name; 97 } 103 98 } 104 99 } -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveTrainingBestSolutionAnalyzer.cs
r5747 r5770 20 20 #endregion 21 21 22 using System.Collections.Generic;23 using System.Linq;24 22 using HeuristicLab.Common; 25 23 using HeuristicLab.Core; 26 24 using HeuristicLab.Data; 27 25 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 28 using HeuristicLab.Operators;29 using HeuristicLab.Optimization;30 26 using HeuristicLab.Parameters; 31 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 41 37 private const string ProblemDataParameterName = "ProblemData"; 42 38 private const string SymbolicDataAnalysisTreeInterpreterParameterName = "SymbolicDataAnalysisTreeInterpreter"; 43 private const string UpperEstimationLimitParameterName = "UpperEstimationLimit"; 44 private const string LowerEstimationLimitParameterName = "LowerEstimationLimit"; 39 private const string EstimationLimitsParameterName = "EstimationLimits"; 45 40 private const string ApplyLinearScalingParameterName = "ApplyLinearScaling"; 46 41 #region parameter properties … … 51 46 get { return (ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[SymbolicDataAnalysisTreeInterpreterParameterName]; } 52 47 } 53 public IValueLookupParameter<DoubleValue> UpperEstimationLimitParameter { 54 get { return (IValueLookupParameter<DoubleValue>)Parameters[UpperEstimationLimitParameterName]; } 55 } 56 57 public IValueLookupParameter<DoubleValue> LowerEstimationLimitParameter { 58 get { return (IValueLookupParameter<DoubleValue>)Parameters[LowerEstimationLimitParameterName]; } 48 public IValueLookupParameter<DoubleLimit> EstimationLimitsParameter { 49 get { return (IValueLookupParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; } 59 50 } 60 51 public IValueParameter<BoolValue> ApplyLinearScalingParameter { … … 64 55 65 56 #region properties 66 public IRegressionProblemData ProblemData {67 get { return ProblemDataParameter.ActualValue; }68 }69 public ISymbolicDataAnalysisExpressionTreeInterpreter SymbolicDataAnalysisTreeInterpreter {70 get { return SymbolicDataAnalysisTreeInterpreterParameter.ActualValue; }71 }72 public DoubleValue UpperEstimationLimit {73 get { return UpperEstimationLimitParameter.ActualValue; }74 }75 public DoubleValue LowerEstimationLimit {76 get { return LowerEstimationLimitParameter.ActualValue; }77 }78 57 public BoolValue ApplyLinearScaling { 79 58 get { return ApplyLinearScalingParameter.Value; } … … 88 67 Parameters.Add(new LookupParameter<IRegressionProblemData>(ProblemDataParameterName, "The problem data for the symbolic regression solution.")); 89 68 Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(SymbolicDataAnalysisTreeInterpreterParameterName, "The symbolic data analysis tree interpreter for the symbolic expression tree.")); 90 Parameters.Add(new ValueLookupParameter<DoubleValue>(UpperEstimationLimitParameterName, "The upper limit for the estimated values produced by the symbolic regression model.")); 91 Parameters.Add(new ValueLookupParameter<DoubleValue>(LowerEstimationLimitParameterName, "The lower limit for the estimated values produced by the symbolic regression model.")); 69 Parameters.Add(new ValueLookupParameter<DoubleLimit>(EstimationLimitsParameterName, "The lower and upper limit for the estimated values produced by the symbolic regression model.")); 92 70 Parameters.Add(new ValueParameter<BoolValue>(ApplyLinearScalingParameterName, "Flag that indicates if the produced symbolic regression solution should be linearly scaled.", new BoolValue(true))); 93 71 } … … 98 76 99 77 protected override ISymbolicRegressionSolution CreateSolution(ISymbolicExpressionTree bestTree, double[] bestQuality) { 100 var model = new SymbolicRegressionModel(bestTree, SymbolicDataAnalysisTreeInterpreter , LowerEstimationLimit.Value, UpperEstimationLimit.Value);101 var solution = new SymbolicRegressionSolution(model, ProblemData );78 var model = new SymbolicRegressionModel(bestTree, SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper); 79 var solution = new SymbolicRegressionSolution(model, ProblemDataParameter.ActualValue); 102 80 if (ApplyLinearScaling.Value) 103 81 solution.ScaleModel(); -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveValidationBestSolutionAnalyzer.cs
r5759 r5770 35 35 public sealed class SymbolicRegressionMultiObjectiveValidationBestSolutionAnalyzer : SymbolicDataAnalysisMultiObjectiveValidationBestSolutionAnalyzer<ISymbolicRegressionSolution, ISymbolicRegressionMultiObjectiveEvaluator, IRegressionProblemData>, 36 36 ISymbolicDataAnalysisBoundedOperator { 37 private const string UpperEstimationLimitParameterName = "UpperEstimationLimit"; 38 private const string LowerEstimationLimitParameterName = "LowerEstimationLimit"; 37 private const string EstimationLimitsParameterName = "EstimationLimits"; 39 38 private const string ApplyLinearScalingParameterName = "ApplyLinearScaling"; 40 39 41 40 #region parameter properties 42 public IValueLookupParameter<DoubleValue> UpperEstimationLimitParameter { 43 get { return (IValueLookupParameter<DoubleValue>)Parameters[UpperEstimationLimitParameterName]; } 44 } 45 46 public IValueLookupParameter<DoubleValue> LowerEstimationLimitParameter { 47 get { return (IValueLookupParameter<DoubleValue>)Parameters[LowerEstimationLimitParameterName]; } 41 public IValueLookupParameter<DoubleLimit> EstimationLimitsParameter { 42 get { return (IValueLookupParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; } 48 43 } 49 44 public IValueParameter<BoolValue> ApplyLinearScalingParameter { … … 62 57 public SymbolicRegressionMultiObjectiveValidationBestSolutionAnalyzer() 63 58 : base() { 64 Parameters.Add(new ValueLookupParameter<DoubleValue>(UpperEstimationLimitParameterName, "The upper limit for the estimated values produced by the symbolic regression model.")); 65 Parameters.Add(new ValueLookupParameter<DoubleValue>(LowerEstimationLimitParameterName, "The lower limit for the estimated values produced by the symbolic regression model.")); 59 Parameters.Add(new ValueLookupParameter<DoubleLimit>(EstimationLimitsParameterName, "The lower and upper limit for the estimated values produced by the symbolic regression model.")); 66 60 Parameters.Add(new ValueParameter<BoolValue>(ApplyLinearScalingParameterName, "Flag that indicates if the produced symbolic regression solution should be linearly scaled.", new BoolValue(true))); 67 61 } … … 71 65 72 66 protected override ISymbolicRegressionSolution CreateSolution(ISymbolicExpressionTree bestTree, double[] bestQuality) { 73 var model = new SymbolicRegressionModel(bestTree, SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, LowerEstimationLimitParameter.ActualValue.Value, UpperEstimationLimitParameter.ActualValue.Value);67 var model = new SymbolicRegressionModel(bestTree, SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper); 74 68 var solution = new SymbolicRegressionSolution(model, ProblemDataParameter.ActualValue); 75 69 if (ApplyLinearScaling.Value) -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveMeanSquaredErrorEvaluator.cs
r5759 r5770 46 46 public override IOperation Apply() { 47 47 IEnumerable<int> rows = GenerateRowsToEvaluate(); 48 double quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, SymbolicExpressionTreeParameter.ActualValue, LowerEstimationLimitParameter.ActualValue.Value, UpperEstimationLimitParameter.ActualValue.Value, ProblemDataParameter.ActualValue, rows);48 double quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, SymbolicExpressionTreeParameter.ActualValue, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, ProblemDataParameter.ActualValue, rows); 49 49 Quality = new DoubleValue(quality); 50 50 return base.Apply(); … … 60 60 public override double Evaluate(IExecutionContext context, ISymbolicExpressionTree tree, IRegressionProblemData problemData, IEnumerable<int> rows) { 61 61 SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = context; 62 LowerEstimationLimitParameter.ExecutionContext = context; 63 UpperEstimationLimitParameter.ExecutionContext = context; 62 EstimationLimitsParameter.ExecutionContext = context; 64 63 65 double mse = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree, LowerEstimationLimitParameter.ActualValue.Value, UpperEstimationLimitParameter.ActualValue.Value, problemData, rows);64 double mse = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, problemData, rows); 66 65 67 66 SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = null; 68 LowerEstimationLimitParameter.ExecutionContext = null; 69 UpperEstimationLimitParameter.ExecutionContext = null; 67 EstimationLimitsParameter.ExecutionContext = null; 70 68 71 69 return mse; -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectivePearsonRSquaredEvaluator.cs
r5759 r5770 47 47 public override IOperation Apply() { 48 48 IEnumerable<int> rows = GenerateRowsToEvaluate(); 49 double quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, SymbolicExpressionTreeParameter.ActualValue, LowerEstimationLimitParameter.ActualValue.Value, UpperEstimationLimitParameter.ActualValue.Value, ProblemDataParameter.ActualValue, rows);49 double quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, SymbolicExpressionTreeParameter.ActualValue, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, ProblemDataParameter.ActualValue, rows); 50 50 Quality = new DoubleValue(quality); 51 51 return base.Apply(); … … 66 66 public override double Evaluate(IExecutionContext context, ISymbolicExpressionTree tree, IRegressionProblemData problemData, IEnumerable<int> rows) { 67 67 SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = context; 68 LowerEstimationLimitParameter.ExecutionContext = context; 69 UpperEstimationLimitParameter.ExecutionContext = context; 68 EstimationLimitsParameter.ExecutionContext = context; 70 69 71 double r2 = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree, LowerEstimationLimitParameter.ActualValue.Value, UpperEstimationLimitParameter.ActualValue.Value, problemData, rows);70 double r2 = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, problemData, rows); 72 71 73 72 SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = null; 74 LowerEstimationLimitParameter.ExecutionContext = null; 75 UpperEstimationLimitParameter.ExecutionContext = null; 73 EstimationLimitsParameter.ExecutionContext = null; 76 74 77 75 return r2; -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveProblem.cs
r5759 r5770 23 23 using HeuristicLab.Common; 24 24 using HeuristicLab.Core; 25 using HeuristicLab.Data;26 25 using HeuristicLab.Parameters; 27 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 35 34 private const int InitialMaximumTreeDepth = 8; 36 35 private const int InitialMaximumTreeLength = 25; 37 private const string LowerEstimationLimitParameterName = "LowerEstimationLimit"; 38 private const string UpperEstimationLimitParameterName = "UpperEstimationLimit"; 39 private const string LowerEstimationLimitParameterDescription = "The lower limit for the estimated value that can be returned by the symbolic regression model."; 40 private const string UpperEstimationLimitParameterDescription = "The upper limit for the estimated value that can be returned by the symbolic regression model."; 36 private const string EstimationLimitsParameterName = "EstimationLimits"; 37 private const string EstimationLimitsParameterDescription = "The limits for the estimated value that can be returned by the symbolic regression model."; 41 38 42 39 #region parameter properties 43 public IFixedValueParameter<DoubleValue> LowerEstimationLimitParameter { 44 get { return (IFixedValueParameter<DoubleValue>)Parameters[LowerEstimationLimitParameterName]; } 45 } 46 public IFixedValueParameter<DoubleValue> UpperEstimationLimitParameter { 47 get { return (IFixedValueParameter<DoubleValue>)Parameters[UpperEstimationLimitParameterName]; } 40 public IFixedValueParameter<DoubleLimit> EstimationLimitsParameter { 41 get { return (IFixedValueParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; } 48 42 } 49 43 #endregion 50 44 #region properties 51 public DoubleValue LowerEstimationLimit { 52 get { return LowerEstimationLimitParameter.Value; } 53 } 54 public DoubleValue UpperEstimationLimit { 55 get { return UpperEstimationLimitParameter.Value; } 45 public DoubleLimit EstimationLimits { 46 get { return EstimationLimitsParameter.Value; } 56 47 } 57 48 #endregion … … 63 54 public SymbolicRegressionSingleObjectiveProblem() 64 55 : base(new RegressionProblemData(), new SymbolicRegressionSingleObjectivePearsonRSquaredEvaluator(), new SymbolicDataAnalysisExpressionTreeCreator()) { 65 Parameters.Add(new FixedValueParameter<DoubleValue>(LowerEstimationLimitParameterName, LowerEstimationLimitParameterDescription, new DoubleValue())); 66 Parameters.Add(new FixedValueParameter<DoubleValue>(UpperEstimationLimitParameterName, UpperEstimationLimitParameterDescription, new DoubleValue())); 56 Parameters.Add(new FixedValueParameter<DoubleLimit>(EstimationLimitsParameterName, EstimationLimitsParameterDescription, new DoubleLimit())); 67 57 68 58 Maximization.Value = true; … … 86 76 var mean = targetValues.Average(); 87 77 var range = targetValues.Max() - targetValues.Min(); 88 UpperEstimationLimit.Value= mean + PunishmentFactor * range;89 LowerEstimationLimit.Value= mean - PunishmentFactor * range;78 EstimationLimits.Upper = mean + PunishmentFactor * range; 79 EstimationLimits.Lower = mean - PunishmentFactor * range; 90 80 } 91 81 } … … 98 88 protected override void ParameterizeOperators() { 99 89 base.ParameterizeOperators(); 100 var operators = Parameters.OfType<IValueParameter>().Select(p => p.Value).OfType<IOperator>().Union(Operators); 101 foreach (var op in operators.OfType<ISymbolicDataAnalysisBoundedOperator>()) { 102 op.LowerEstimationLimitParameter.ActualName = LowerEstimationLimitParameterName; 103 op.UpperEstimationLimitParameter.ActualName = UpperEstimationLimitParameterName; 90 if (Parameters.ContainsKey(EstimationLimitsParameterName)) { 91 var operators = Parameters.OfType<IValueParameter>().Select(p => p.Value).OfType<IOperator>().Union(Operators); 92 foreach (var op in operators.OfType<ISymbolicDataAnalysisBoundedOperator>()) { 93 op.EstimationLimitsParameter.ActualName = EstimationLimitsParameter.Name; 94 } 104 95 } 105 96 } -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveTrainingBestSolutionAnalyzer.cs
r5747 r5770 20 20 #endregion 21 21 22 using System.Collections.Generic;23 using System.Linq;24 22 using HeuristicLab.Common; 25 23 using HeuristicLab.Core; 26 24 using HeuristicLab.Data; 27 25 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 28 using HeuristicLab.Operators;29 using HeuristicLab.Optimization;30 26 using HeuristicLab.Parameters; 31 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 41 37 private const string ProblemDataParameterName = "ProblemData"; 42 38 private const string SymbolicDataAnalysisTreeInterpreterParameterName = "SymbolicDataAnalysisTreeInterpreter"; 43 private const string UpperEstimationLimitParameterName = "UpperEstimationLimit"; 44 private const string LowerEstimationLimitParameterName = "LowerEstimationLimit"; 39 private const string EstimationLimitsParameterName = "EstimationLimits"; 45 40 private const string ApplyLinearScalingParameterName = "ApplyLinearScaling"; 46 41 #region parameter properties … … 51 46 get { return (ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[SymbolicDataAnalysisTreeInterpreterParameterName]; } 52 47 } 53 public IValueLookupParameter<DoubleValue> UpperEstimationLimitParameter { 54 get { return (IValueLookupParameter<DoubleValue>)Parameters[UpperEstimationLimitParameterName]; } 55 } 56 57 public IValueLookupParameter<DoubleValue> LowerEstimationLimitParameter { 58 get { return (IValueLookupParameter<DoubleValue>)Parameters[LowerEstimationLimitParameterName]; } 48 public IValueLookupParameter<DoubleLimit> EstimationLimitsParameter { 49 get { return (IValueLookupParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; } 59 50 } 60 51 public IValueParameter<BoolValue> ApplyLinearScalingParameter { … … 64 55 65 56 #region properties 66 public IRegressionProblemData ProblemData {67 get { return ProblemDataParameter.ActualValue; }68 }69 public ISymbolicDataAnalysisExpressionTreeInterpreter SymbolicDataAnalysisTreeInterpreter {70 get { return SymbolicDataAnalysisTreeInterpreterParameter.ActualValue; }71 }72 public DoubleValue UpperEstimationLimit {73 get { return UpperEstimationLimitParameter.ActualValue; }74 }75 public DoubleValue LowerEstimationLimit {76 get { return LowerEstimationLimitParameter.ActualValue; }77 }78 57 public BoolValue ApplyLinearScaling { 79 58 get { return ApplyLinearScalingParameter.Value; } 80 59 } 81 60 #endregion 61 82 62 [StorableConstructor] 83 63 private SymbolicRegressionSingleObjectiveTrainingBestSolutionAnalyzer(bool deserializing) : base(deserializing) { } … … 87 67 Parameters.Add(new LookupParameter<IRegressionProblemData>(ProblemDataParameterName, "The problem data for the symbolic regression solution.")); 88 68 Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(SymbolicDataAnalysisTreeInterpreterParameterName, "The symbolic data analysis tree interpreter for the symbolic expression tree.")); 89 Parameters.Add(new ValueLookupParameter<DoubleValue>(UpperEstimationLimitParameterName, "The upper limit for the estimated values produced by the symbolic regression model.")); 90 Parameters.Add(new ValueLookupParameter<DoubleValue>(LowerEstimationLimitParameterName, "The lower limit for the estimated values produced by the symbolic regression model.")); 69 Parameters.Add(new ValueLookupParameter<DoubleLimit>(EstimationLimitsParameterName, "The lower and upper limit for the estimated values produced by the symbolic regression model.")); 91 70 Parameters.Add(new ValueParameter<BoolValue>(ApplyLinearScalingParameterName, "Flag that indicates if the produced symbolic regression solution should be linearly scaled.", new BoolValue(true))); 92 71 } … … 96 75 97 76 protected override ISymbolicRegressionSolution CreateSolution(ISymbolicExpressionTree bestTree, double bestQuality) { 98 var model = new SymbolicRegressionModel(bestTree, SymbolicDataAnalysisTreeInterpreter , LowerEstimationLimit.Value, UpperEstimationLimit.Value);99 var solution = new SymbolicRegressionSolution(model, ProblemData );77 var model = new SymbolicRegressionModel(bestTree, SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper); 78 var solution = new SymbolicRegressionSolution(model, ProblemDataParameter.ActualValue); 100 79 if (ApplyLinearScaling.Value) 101 80 solution.ScaleModel(); -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveValidationBestSolutionAnalyzer.cs
r5759 r5770 35 35 public sealed class SymbolicRegressionSingleObjectiveValidationBestSolutionAnalyzer : SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer<ISymbolicRegressionSolution, ISymbolicRegressionSingleObjectiveEvaluator, IRegressionProblemData>, 36 36 ISymbolicDataAnalysisBoundedOperator { 37 private const string UpperEstimationLimitParameterName = "UpperEstimationLimit"; 38 private const string LowerEstimationLimitParameterName = "LowerEstimationLimit"; 37 private const string EstimationLimitsParameterName = "EstimationLimits"; 39 38 private const string ApplyLinearScalingParameterName = "ApplyLinearScaling"; 39 40 40 #region parameter properties 41 public IValueLookupParameter<DoubleValue> UpperEstimationLimitParameter { 42 get { return (IValueLookupParameter<DoubleValue>)Parameters[UpperEstimationLimitParameterName]; } 43 } 44 45 public IValueLookupParameter<DoubleValue> LowerEstimationLimitParameter { 46 get { return (IValueLookupParameter<DoubleValue>)Parameters[LowerEstimationLimitParameterName]; } 41 public IValueLookupParameter<DoubleLimit> EstimationLimitsParameter { 42 get { return (IValueLookupParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; } 47 43 } 48 44 public IValueParameter<BoolValue> ApplyLinearScalingParameter { … … 62 58 public SymbolicRegressionSingleObjectiveValidationBestSolutionAnalyzer() 63 59 : base() { 64 Parameters.Add(new ValueLookupParameter<DoubleValue>(UpperEstimationLimitParameterName, "The upper limit for the estimated values produced by the symbolic regression model.")); 65 Parameters.Add(new ValueLookupParameter<DoubleValue>(LowerEstimationLimitParameterName, "The lower limit for the estimated values produced by the symbolic regression model.")); 60 Parameters.Add(new ValueLookupParameter<DoubleLimit>(EstimationLimitsParameterName, "The lower and upper limit for the estimated values produced by the symbolic regression model.")); 66 61 Parameters.Add(new ValueParameter<BoolValue>(ApplyLinearScalingParameterName, "Flag that indicates if the produced symbolic regression solution should be linearly scaled.", new BoolValue(true))); 67 62 } … … 72 67 73 68 protected override ISymbolicRegressionSolution CreateSolution(ISymbolicExpressionTree bestTree, double bestQuality) { 74 var model = new SymbolicRegressionModel(bestTree, SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, LowerEstimationLimitParameter.ActualValue.Value, UpperEstimationLimitParameter.ActualValue.Value);69 var model = new SymbolicRegressionModel(bestTree, SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper); 75 70 var solution = new SymbolicRegressionSolution(model, ProblemDataParameter.ActualValue); 76 71 if (ApplyLinearScaling.Value) -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Evaluators/SymbolicDataAnalysisEvaluator.cs
r5759 r5770 41 41 private const string SymbolicDataAnalysisTreeInterpreterParameterName = "SymbolicExpressionTreeInterpreter"; 42 42 private const string ProblemDataParameterName = "ProblemData"; 43 private const string UpperEstimationLimitParameterName = "UpperEstimationLimit"; 44 private const string LowerEstimationLimitParameterName = "LowerEstimationLimit"; 43 private const string EstimationLimitsParameterName = "EstimationLimits"; 45 44 private const string EvaluationPartitionParameterName = "EvaluationPartition"; 46 45 private const string RelativeNumberOfEvaluatedSamplesParameterName = "RelativeNumberOfEvaluatedSamples"; … … 65 64 get { return (IValueLookupParameter<IntRange>)Parameters[EvaluationPartitionParameterName]; } 66 65 } 67 68 public IValueLookupParameter<DoubleValue> UpperEstimationLimitParameter { 69 get { return (IValueLookupParameter<DoubleValue>)Parameters[UpperEstimationLimitParameterName]; } 66 public IValueLookupParameter<DoubleLimit> EstimationLimitsParameter { 67 get { return (IValueLookupParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; } 70 68 } 71 public IValueLookupParameter<DoubleValue> LowerEstimationLimitParameter {72 get { return (IValueLookupParameter<DoubleValue>)Parameters[LowerEstimationLimitParameterName]; }73 }74 75 69 public IValueLookupParameter<PercentValue> RelativeNumberOfEvaluatedSamplesParameter { 76 70 get { return (IValueLookupParameter<PercentValue>)Parameters[RelativeNumberOfEvaluatedSamplesParameterName]; } … … 91 85 Parameters.Add(new ValueLookupParameter<T>(ProblemDataParameterName, "The problem data on which the symbolic data analysis solution should be evaluated.")); 92 86 Parameters.Add(new ValueLookupParameter<IntRange>(EvaluationPartitionParameterName, "The start index of the dataset partition on which the symbolic data analysis solution should be evaluated.")); 93 Parameters.Add(new ValueLookupParameter<DoubleValue>(UpperEstimationLimitParameterName, "The upper limit that should be used as cut off value for the output values of symbolic data analysis trees.")); 94 Parameters.Add(new ValueLookupParameter<DoubleValue>(LowerEstimationLimitParameterName, "The lower limit that should be used as cut off value for the output values of symbolic data analysis trees.")); 87 Parameters.Add(new ValueLookupParameter<DoubleLimit>(EstimationLimitsParameterName, "The upper and lower limit that should be used as cut off value for the output values of symbolic data analysis trees.")); 95 88 Parameters.Add(new ValueLookupParameter<PercentValue>(RelativeNumberOfEvaluatedSamplesParameterName, "The relative number of samples of the dataset partition, which should be randomly chosen for evaluation between the start and end index.")); 96 89 } … … 104 97 int count = (int)((samplesEnd - samplesStart) * RelativeNumberOfEvaluatedSamplesParameter.ActualValue.Value); 105 98 if (count == 0) count = 1; 106 return RandomEnumerable.SampleRandomNumbers(seed, samples End, samplesStart, count)99 return RandomEnumerable.SampleRandomNumbers(seed, samplesStart, samplesEnd, count) 107 100 .Where(i => i < ProblemDataParameter.ActualValue.TestPartition.Start || ProblemDataParameter.ActualValue.TestPartition.End <= i); 108 101 } -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisBoundedOperator.cs
r5720 r5770 20 20 #endregion 21 21 22 23 22 using HeuristicLab.Core; 24 using HeuristicLab.Data;25 23 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { 26 24 public interface ISymbolicDataAnalysisBoundedOperator : IOperator { 27 IValueLookupParameter<DoubleValue> UpperEstimationLimitParameter { get; } 28 IValueLookupParameter<DoubleValue> LowerEstimationLimitParameter { get; } 25 IValueLookupParameter<DoubleLimit> EstimationLimitsParameter { get; } 29 26 } 30 27 } -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs
r5759 r5770 33 33 using HeuristicLab.PluginInfrastructure; 34 34 35 //TODO configure training start / end36 //TODO configure analyzer validation37 38 35 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { 39 36 [StorableClass] … … 42 39 where U : class, ISymbolicDataAnalysisEvaluator<T> 43 40 where V : class, ISymbolicDataAnalysisSolutionCreator { 41 44 42 #region parameter names & descriptions 45 43 private const string ProblemDataParameterName = "ProblemData"; … … 174 172 SymbolicExpressionTreeInterpreter = new SymbolicDataAnalysisExpressionTreeInterpreter(); 175 173 174 FitnessCalculationPartition.Start = ProblemData.TrainingPartition.Start; 175 FitnessCalculationPartition.End = ProblemData.TrainingPartition.End; 176 176 177 InitializeOperators(); 177 178 … … 240 241 public event EventHandler ProblemDataChanged; 241 242 protected virtual void OnProblemDataChanged() { 243 FitnessCalculationPartition.Start = ProblemData.TrainingPartition.Start; 244 FitnessCalculationPartition.End = ProblemData.TrainingPartition.End; 245 242 246 UpdateGrammar(); 243 247 ParameterizeOperators(); -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Views/3.4/DoubleLimitView.Designer.cs
r5769 r5770 19 19 */ 20 20 #endregion 21 namespace HeuristicLab. Data.Views {22 public partial class Double RangeView {21 namespace HeuristicLab.Problems.DataAnalysis.Views { 22 public partial class DoubleLimitView { 23 23 /// <summary> 24 24 /// Required designer variable. … … 48 48 // Item1Label 49 49 // 50 this.Item1Label.Size = new System.Drawing.Size(3 2, 13);51 this.Item1Label.Text = " Start:";50 this.Item1Label.Size = new System.Drawing.Size(39, 13); 51 this.Item1Label.Text = "Lower:"; 52 52 // 53 53 // Item2Label 54 54 // 55 this.Item2Label.Size = new System.Drawing.Size( 29, 13);56 this.Item2Label.Text = " End:";55 this.Item2Label.Size = new System.Drawing.Size(39, 13); 56 this.Item2Label.Text = "Upper:"; 57 57 // 58 // IntRangeView58 // DoubleLimitView 59 59 // 60 60 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 61 this.Name = " IntRangeView";61 this.Name = "DoubleLimitView"; 62 62 this.ResumeLayout(false); 63 63 this.PerformLayout(); 64 64 65 } 65 66 -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Views/3.4/DoubleLimitView.cs
r5769 r5770 21 21 22 22 using System.Windows.Forms; 23 using HeuristicLab.Data.Views; 23 24 using HeuristicLab.MainForm; 24 25 using HeuristicLab.MainForm.WindowsForms; 25 26 26 namespace HeuristicLab. Data.Views {27 namespace HeuristicLab.Problems.DataAnalysis.Views { 27 28 [View("DoubleRange View")] 28 [Content(typeof(Double Range), true)]29 public partial class Double RangeView : StringConvertibleValueTupleView {29 [Content(typeof(DoubleLimit), true)] 30 public partial class DoubleLimitView : StringConvertibleValueTupleView { 30 31 31 public new Double RangeContent {32 get { return (Double Range)base.Content; }32 public new DoubleLimit Content { 33 get { return (DoubleLimit)base.Content; } 33 34 set { base.Content = value; } 34 35 } 35 36 36 public Double RangeView() {37 public DoubleLimitView() { 37 38 InitializeComponent(); 38 39 } -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj
r5694 r5770 146 146 <DependentUpon>DataAnalysisSolutionView.cs</DependentUpon> 147 147 </Compile> 148 <Compile Include="DoubleLimitView.cs"> 149 <SubType>UserControl</SubType> 150 </Compile> 151 <Compile Include="DoubleLimitView.Designer.cs"> 152 <DependentUpon>DoubleLimitView.cs</DependentUpon> 153 </Compile> 148 154 <Compile Include="Regression\RegressionSolutionEstimatedValuesView.cs"> 149 155 <SubType>UserControl</SubType> -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj
r5731 r5770 108 108 </ItemGroup> 109 109 <ItemGroup> 110 <Compile Include="DoubleLimit.cs" /> 110 111 <Compile Include="Implementation\Classification\ClassificationProblemData.cs" /> 111 112 <Compile Include="Implementation\Classification\ClassificationProblem.cs" />
Note: See TracChangeset
for help on using the changeset viewer.