Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/11/10 11:53:45 (14 years ago)
Author:
gkronber
Message:

Moved upper and lower estimation limit parameters into ISymbolicRegressionEvaluator interface and introduced an Evaluate method in the interface in preparation for a ISymbolicRegressionEvaluator parameter for the validation best solution analyzer. #1117

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Evaluators/SingleObjectiveSymbolicRegressionEvaluator.cs

    r4128 r4190  
    3939    private const string FunctionTreeParameterName = "FunctionTree";
    4040    private const string RegressionProblemDataParameterName = "RegressionProblemData";
     41    private const string UpperEstimationLimitParameterName = "UpperEstimationLimit";
     42    private const string LowerEstimationLimitParameterName = "LowerEstimationLimit";
    4143    private const string SamplesStartParameterName = "SamplesStart";
    4244    private const string SamplesEndParameterName = "SamplesEnd";
     
    4446    #region ISymbolicRegressionEvaluator Members
    4547
     48    public ILookupParameter<IRandom> RandomParameter {
     49      get { return (ILookupParameter<IRandom>)Parameters[RandomParameterName]; }
     50    }
    4651    public ILookupParameter<DoubleValue> QualityParameter {
    4752      get { return (ILookupParameter<DoubleValue>)Parameters[QualityParameterName]; }
     
    6772      get { return (IValueLookupParameter<IntValue>)Parameters[SamplesEndParameterName]; }
    6873    }
    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    }
    7080    public IValueParameter<PercentValue> RelativeNumberOfEvaluatedSamplesParameter {
    7181      get { return (IValueParameter<PercentValue>)Parameters[RelativeNumberOfEvaluatedSamplesParameterName]; }
    7282    }
    7383
    74     public ILookupParameter<IRandom> RandomParameter {
    75       get { return (ILookupParameter<IRandom>)Parameters[RandomParameterName]; }
    76     }
    7784
    7885    #endregion
     
    96103      get { return SamplesEndParameter.ActualValue; }
    97104    }
    98 
     105    public DoubleValue UpperEstimationLimit {
     106      get { return UpperEstimationLimitParameter.ActualValue; }
     107    }
     108    public DoubleValue LowerEstimationLimit {
     109      get { return LowerEstimationLimitParameter.ActualValue; }
     110    }
    99111    public PercentValue RelativeNumberOfEvaluatedSamples {
    100112      get { return RelativeNumberOfEvaluatedSamplesParameter.Value; }
     
    111123      Parameters.Add(new ValueLookupParameter<IntValue>(SamplesStartParameterName, "The start index of the dataset partition on which the symbolic regression solution should be evaluated."));
    112124      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."));
    113127      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)));
    114128    }
     
    127141      uint seed = (uint)Random.Next();
    128142      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);
    131146      QualityParameter.ActualValue = new DoubleValue(quality);
    132147      return base.Apply();
     
    141156    }
    142157
    143     protected abstract double Evaluate(ISymbolicExpressionTreeInterpreter interpreter,
    144       SymbolicExpressionTree solution,
     158    public abstract double Evaluate(ISymbolicExpressionTreeInterpreter interpreter,
     159      SymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit,
    145160      Dataset dataset,
    146       StringValue targetVariable,
     161      string targetVariable,
    147162      IEnumerable<int> rows);
    148163  }
Note: See TracChangeset for help on using the changeset viewer.