Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/22/21 14:59:58 (4 years ago)
Author:
gkronber
Message:

#3073: refactoring ShapeConstrainedRegressionProblem as discussed with MKo and CHa

Location:
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4
Files:
4 added
2 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.csproj

    r17931 r17958  
    119119  </ItemGroup>
    120120  <ItemGroup>
    121     <Compile Include="MultiObjective\NMSEConstraintsEvaluator.cs" />
     121    <Compile Include="Interfaces\IMultiObjectiveConstaintsEvaluator.cs" />
     122    <Compile Include="MultiObjective\NMSEMultiObjectiveConstraintsEvaluator.cs" />
    122123    <Compile Include="MultiObjective\PearsonRSquaredNestedTreeSizeEvaluator.cs" />
    123124    <Compile Include="MultiObjective\PearsonRSquaredNumberOfVariablesEvaluator.cs" />
    124125    <Compile Include="MultiObjective\PearsonRSquaredAverageSimilarityEvaluator.cs" />
    125126    <Compile Include="MultiObjective\PearsonRSquaredTreeComplexityEvaluator.cs" />
     127    <Compile Include="MultiObjective\ShapeConstrainedRegressionMultiObjectiveProblem.cs" />
    126128    <Compile Include="MultiObjective\SymbolicRegressionMultiObjectiveValidationBestSolutionAnalyzer.cs" />
    127129    <Compile Include="Plugin.cs" />
    128130    <Compile Include="ShapeConstraintsAnalyzer.cs" />
    129131    <Compile Include="SingleObjective\ConstantOptimizationAnalyzer.cs" />
    130     <Compile Include="SingleObjective\Evaluators\NMSEConstraintsEvaluator.cs" />
     132    <Compile Include="SingleObjective\Evaluators\NMSESingleObjectiveConstraintsEvaluator.cs" />
    131133    <Compile Include="SingleObjective\Evaluators\SymbolicRegressionMeanRelativeErrorEvaluator.cs" />
     134    <Compile Include="SingleObjective\ShapeConstrainedRegressionSingleObjectiveProblem.cs" />
    132135    <Compile Include="SingleObjective\SymbolicRegressionSolutionsAnalyzer.cs" />
    133136    <Compile Include="SymbolicRegressionPhenotypicDiversityAnalyzer.cs" />
  • trunk/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveProblem.cs

    r17180 r17958  
    6060    public override IDeepCloneable Clone(Cloner cloner) { return new SymbolicRegressionMultiObjectiveProblem(this, cloner); }
    6161
    62     public SymbolicRegressionMultiObjectiveProblem()
    63       : base(new RegressionProblemData(), new SymbolicRegressionMultiObjectivePearsonRSquaredTreeSizeEvaluator(), new SymbolicDataAnalysisExpressionTreeCreator()) {
     62    public SymbolicRegressionMultiObjectiveProblem() : this(new RegressionProblemData(), new SymbolicRegressionMultiObjectivePearsonRSquaredTreeSizeEvaluator(), new SymbolicDataAnalysisExpressionTreeCreator()) { }
     63    public SymbolicRegressionMultiObjectiveProblem(IRegressionProblemData problemData, ISymbolicRegressionMultiObjectiveEvaluator evaluator, ISymbolicDataAnalysisSolutionCreator solutionCreator)
     64      : base(problemData, evaluator, solutionCreator) {
    6465      Parameters.Add(new FixedValueParameter<DoubleLimit>(EstimationLimitsParameterName, EstimationLimitsParameterDescription));
    6566
  • trunk/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/ShapeConstraintsAnalyzer.cs

    r17906 r17958  
    3131namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression {
    3232  [StorableType("4318C6BD-E0A1-45FE-AC30-96E7F73B51FB")]
    33   [Item("ShapeConstraintsAnalyzer", "Analyzes the number of shape-constraint violations of symbolic regression models.")]
     33  [Item("ShapeConstraintsAnalyzer", "Analyzes the number of shape constraint violations of symbolic regression models.")]
    3434  public class ShapeConstraintsAnalyzer : SymbolicDataAnalysisAnalyzer, ISymbolicExpressionTreeAnalyzer {
    3535    private const string ProblemDataParameterName = "ProblemData";
     
    9797
    9898    public override IOperation Apply() {
    99       var problemData = RegressionProblemData;
     99      var problemData = (IShapeConstrainedRegressionProblemData)RegressionProblemData;
    100100      var trees = SymbolicExpressionTree.ToArray();
    101101
     
    115115      }
    116116
    117       var constraintUnsatisfiedSolutionsDataTable = InfeasibleSolutions;
    118       if (constraintUnsatisfiedSolutionsDataTable.Rows.Count == 0)
    119         constraintUnsatisfiedSolutionsDataTable.Rows.Add(new DataRow(InfeasibleSolutionsParameterName));
     117      var infeasibleSolutionsDataTable = InfeasibleSolutions;
     118      if (infeasibleSolutionsDataTable.Rows.Count == 0)
     119        infeasibleSolutionsDataTable.Rows.Add(new DataRow(InfeasibleSolutionsParameterName));
    120120
    121       constraintUnsatisfiedSolutionsDataTable.Rows[InfeasibleSolutionsParameterName]
     121      infeasibleSolutionsDataTable.Rows[InfeasibleSolutionsParameterName]
    122122        .Values
    123123        .Add(trees.Count(t => IntervalUtil.GetConstraintViolations(constraints, estimator, variableRanges, t).Any(x => x > 0.0)));
  • trunk/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveProblem.cs

    r17903 r17958  
    5656    public override IDeepCloneable Clone(Cloner cloner) { return new SymbolicRegressionSingleObjectiveProblem(this, cloner); }
    5757
    58     public SymbolicRegressionSingleObjectiveProblem()
    59       : base(new RegressionProblemData(), new SymbolicRegressionSingleObjectivePearsonRSquaredEvaluator(), new SymbolicDataAnalysisExpressionTreeCreator()) {
     58    public SymbolicRegressionSingleObjectiveProblem() : this(new RegressionProblemData(), new SymbolicRegressionSingleObjectivePearsonRSquaredEvaluator(), new SymbolicDataAnalysisExpressionTreeCreator()) {
     59    }
     60    public SymbolicRegressionSingleObjectiveProblem(IRegressionProblemData problemData, ISymbolicRegressionSingleObjectiveEvaluator evaluator, ISymbolicDataAnalysisSolutionCreator solutionCreator) :
     61      base(problemData, evaluator, solutionCreator) {
     62
    6063      Parameters.Add(new FixedValueParameter<DoubleLimit>(EstimationLimitsParameterName, EstimationLimitsParameterDescription));
    6164
Note: See TracChangeset for help on using the changeset viewer.