Changeset 16800 for branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators
- Timestamp:
- 04/17/19 14:37:55 (6 years ago)
- 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 61 61 62 62 //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); 64 64 var intervalInterpreter = new IntervalInterpreter(); 65 var variableRanges = ((RegressionProblemData) problemData).VariableRangesParameter.Value.VariableIntervals;65 var variableRanges = ((RegressionProblemData) problemData).VariableRangesParameter.Value.VariableIntervals; 66 66 67 67 … … 92 92 93 93 private static bool HasConstraintVioluations(IEnumerable<IntervalConstraint> constraints, IntervalInterpreter intervalInterpreter, 94 Dictionary<string, Interval> variableRanges, ISymbolicExpressionTree solution) {94 IDictionary<string, Interval> variableRanges, ISymbolicExpressionTree solution) { 95 95 foreach (var constraint in constraints) { 96 96 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 64 64 var variableRanges = ((RegressionProblemData)problemData).VariableRangesParameter.Value.VariableIntervals; 65 65 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 // TODO89 // 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 99 66 double r; 100 67 if (applyLinearScaling) { … … 142 109 143 110 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) { 145 112 foreach (var constraint in constraints) { 146 113 if (constraint.Variable != null && !variableRanges.ContainsKey(constraint.Variable))
Note: See TracChangeset
for help on using the changeset viewer.