Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/17/19 14:37:55 (6 years ago)
Author:
chaider
Message:

#2971 Several chanages regarding review comments

Location:
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveConstraintConstOptEvaluator.cs

    r16781 r16800  
    6161
    6262      //var constraints = IntervalConstraintsParser.Parse(((RegressionProblemData)problemData).IntervalConstraintsParameter.Value.Value);
    63       var constraints = ((RegressionProblemData)problemData).IntervalConstraintsParameter.Value.Constraints.Where(x => x.IsChecked);
     63      var constraints = ((RegressionProblemData)problemData).IntervalConstraintsParameter.Value.Constraints.Where(x => x.Enabled);
    6464      var intervalInterpreter = new IntervalInterpreter();
    65       var variableRanges = ((RegressionProblemData)problemData).VariableRangesParameter.Value.VariableIntervals;
     65      var variableRanges = ((RegressionProblemData) problemData).VariableRangesParameter.Value.VariableIntervals;
    6666
    6767
     
    9292
    9393    private static bool HasConstraintVioluations(IEnumerable<IntervalConstraint> constraints, IntervalInterpreter intervalInterpreter,
    94       Dictionary<string, Interval> variableRanges, ISymbolicExpressionTree solution) {
     94      IDictionary<string, Interval> variableRanges, ISymbolicExpressionTree solution) {
    9595      foreach (var constraint in constraints) {
    9696        if (constraint.Variable != null && !variableRanges.ContainsKey(constraint.Variable))
  • branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveConstraintPearsonRSquaredEvaluator.cs

    r16756 r16800  
    6464      var variableRanges = ((RegressionProblemData)problemData).VariableRangesParameter.Value.VariableIntervals;
    6565
    66 
    67       //foreach (var constraint in constraints) {
    68       //  if (constraint.Variable != null && !variableRanges.ContainsKey(constraint.Variable))
    69       //    throw new ArgumentException($"The given variable {constraint.Variable} in the constraint does not exists in the model.", nameof(IntervalConstraintsParser));
    70       //  if (!constraint.IsDerivation) {
    71       //    var res = intervalInterpreter.GetSymbolicExressionTreeInterval(solution, variableRanges);
    72       //    if (!constraint.Interval.Contains(res, constraint.InclusiveLowerBound,
    73       //      constraint.InclusiveUpperBound)) {
    74       //      return 0;
    75       //    }
    76       //  } else {
    77       //    var tree = solution;
    78       //    for (var i = 0; i < constraint.NumberOfDerivation; ++i) {
    79       //      tree = DerivativeCalculator.Derive(tree, constraint.Variable);
    80       //    }
    81       //    var res = intervalInterpreter.GetSymbolicExressionTreeInterval(tree, variableRanges);
    82       //    if (!constraint.Interval.Contains(res, constraint.InclusiveLowerBound,
    83       //      constraint.InclusiveUpperBound)) {
    84       //      return 0;
    85       //    }
    86       //  }
    87       //}
    88       // TODO
    89       // m = new SymbolicRegressionModel(...)
    90       // m.Scale();
    91 
    92       // var e = m.GetEstimatedValues (TRAINING)
    93       // OnlinePearsonCalc.Calculate(e, TARGET_TRAIING)
    94 
    95       // scaledTree = model.Tree;
    96 
    97       // constraints mit scaledTree berechnen (auch die Ableitungen)
    98 
    9966      double r;
    10067      if (applyLinearScaling) {
     
    142109
    143110    private static bool CheckConstraintsViolations(IEnumerable<IntervalConstraint> constraints, IntervalInterpreter intervalInterpreter,
    144       Dictionary<string, Interval> variableRanges, ISymbolicExpressionTree solution, out double r) {
     111      IDictionary<string, Interval> variableRanges, ISymbolicExpressionTree solution, out double r) {
    145112      foreach (var constraint in constraints) {
    146113        if (constraint.Variable != null && !variableRanges.ContainsKey(constraint.Variable))
Note: See TracChangeset for help on using the changeset viewer.