Changeset 4190 for trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Evaluators/SingleObjectiveSymbolicRegressionEvaluator.cs
- Timestamp:
- 08/11/10 11:53:45 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Evaluators/SingleObjectiveSymbolicRegressionEvaluator.cs
r4128 r4190 39 39 private const string FunctionTreeParameterName = "FunctionTree"; 40 40 private const string RegressionProblemDataParameterName = "RegressionProblemData"; 41 private const string UpperEstimationLimitParameterName = "UpperEstimationLimit"; 42 private const string LowerEstimationLimitParameterName = "LowerEstimationLimit"; 41 43 private const string SamplesStartParameterName = "SamplesStart"; 42 44 private const string SamplesEndParameterName = "SamplesEnd"; … … 44 46 #region ISymbolicRegressionEvaluator Members 45 47 48 public ILookupParameter<IRandom> RandomParameter { 49 get { return (ILookupParameter<IRandom>)Parameters[RandomParameterName]; } 50 } 46 51 public ILookupParameter<DoubleValue> QualityParameter { 47 52 get { return (ILookupParameter<DoubleValue>)Parameters[QualityParameterName]; } … … 67 72 get { return (IValueLookupParameter<IntValue>)Parameters[SamplesEndParameterName]; } 68 73 } 69 74 public IValueLookupParameter<DoubleValue> UpperEstimationLimitParameter { 75 get { return (IValueLookupParameter<DoubleValue>)Parameters[UpperEstimationLimitParameterName]; } 76 } 77 public IValueLookupParameter<DoubleValue> LowerEstimationLimitParameter { 78 get { return (IValueLookupParameter<DoubleValue>)Parameters[LowerEstimationLimitParameterName]; } 79 } 70 80 public IValueParameter<PercentValue> RelativeNumberOfEvaluatedSamplesParameter { 71 81 get { return (IValueParameter<PercentValue>)Parameters[RelativeNumberOfEvaluatedSamplesParameterName]; } 72 82 } 73 83 74 public ILookupParameter<IRandom> RandomParameter {75 get { return (ILookupParameter<IRandom>)Parameters[RandomParameterName]; }76 }77 84 78 85 #endregion … … 96 103 get { return SamplesEndParameter.ActualValue; } 97 104 } 98 105 public DoubleValue UpperEstimationLimit { 106 get { return UpperEstimationLimitParameter.ActualValue; } 107 } 108 public DoubleValue LowerEstimationLimit { 109 get { return LowerEstimationLimitParameter.ActualValue; } 110 } 99 111 public PercentValue RelativeNumberOfEvaluatedSamples { 100 112 get { return RelativeNumberOfEvaluatedSamplesParameter.Value; } … … 111 123 Parameters.Add(new ValueLookupParameter<IntValue>(SamplesStartParameterName, "The start index of the dataset partition on which the symbolic regression solution should be evaluated.")); 112 124 Parameters.Add(new ValueLookupParameter<IntValue>(SamplesEndParameterName, "The end index of the dataset partition on which the symbolic regression solution should be evaluated.")); 125 Parameters.Add(new ValueLookupParameter<DoubleValue>(UpperEstimationLimitParameterName, "The upper limit that should be used as cut off value for the output values of symbolic expression trees.")); 126 Parameters.Add(new ValueLookupParameter<DoubleValue>(LowerEstimationLimitParameterName, "The lower limit that should be used as cut off value for the output values of symbolic expression trees.")); 113 127 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))); 114 128 } … … 127 141 uint seed = (uint)Random.Next(); 128 142 IEnumerable<int> rows = GenerateRowsToEvaluate(seed, RelativeNumberOfEvaluatedSamples.Value, SamplesStart.Value, SamplesEnd.Value); 129 double quality = Evaluate(SymbolicExpressionTreeInterpreter, SymbolicExpressionTree, RegressionProblemData.Dataset, 130 RegressionProblemData.TargetVariable, rows); 143 double quality = Evaluate(SymbolicExpressionTreeInterpreter, SymbolicExpressionTree, LowerEstimationLimit.Value, UpperEstimationLimit.Value, 144 RegressionProblemData.Dataset, 145 RegressionProblemData.TargetVariable.Value, rows); 131 146 QualityParameter.ActualValue = new DoubleValue(quality); 132 147 return base.Apply(); … … 141 156 } 142 157 143 p rotectedabstract double Evaluate(ISymbolicExpressionTreeInterpreter interpreter,144 SymbolicExpressionTree solution, 158 public abstract double Evaluate(ISymbolicExpressionTreeInterpreter interpreter, 159 SymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, 145 160 Dataset dataset, 146 StringValuetargetVariable,161 string targetVariable, 147 162 IEnumerable<int> rows); 148 163 }
Note: See TracChangeset
for help on using the changeset viewer.