Changeset 18181
- Timestamp:
- 01/10/22 15:17:35 (3 years ago)
- Location:
- branches/3138_Shape_Constraints_Transformations/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3138_Shape_Constraints_Transformations/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.csproj
r18180 r18181 119 119 </ItemGroup> 120 120 <ItemGroup> 121 <Compile Include="ExtendedConstraint.cs" /> 121 122 <Compile Include="Interfaces\IMultiObjectiveConstraintsEvaluator.cs" /> 122 123 <Compile Include="MultiObjective\NMSEMultiObjectiveConstraintsEvaluator.cs" /> -
branches/3138_Shape_Constraints_Transformations/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/NMSESingleObjectiveConstraintsEvaluator.cs
r18180 r18181 41 41 private const string BoundsEstimatorParameterName = "BoundsEstimator"; 42 42 private const string PenaltyFactorParameterName = "PenaltyFactor"; 43 private const string ExtendedConstraintsParameterName = "ExtendedConstraints"; 43 44 44 45 … … 57 58 (IFixedValueParameter<DoubleValue>)Parameters[PenaltyFactorParameterName]; 58 59 60 public IFixedValueParameter<IItemList<ExtendedConstraint>> ExtendedConstraintsParameter => 61 (IFixedValueParameter<IItemList<ExtendedConstraint>>)Parameters[ExtendedConstraintsParameterName]; 62 63 59 64 public bool OptimizeParameters { 60 65 get => OptimizerParametersParameter.Value.Value; … … 81 86 set => PenaltyFactorParameter.Value.Value = value; 82 87 } 88 89 public IEnumerable<ExtendedConstraint> ExtendedConstraints { 90 get => ExtendedConstraintsParameter.Value; 91 } 92 83 93 84 94 … … 106 116 Parameters.Add(new FixedValueParameter<DoubleValue>(PenaltyFactorParameterName, 107 117 "Punishment factor for constraint violations for soft constraint handling (fitness = NMSE + penaltyFactor * avg(violations)) (default: 1.0)", new DoubleValue(1.0))); 118 Parameters.Add(new FixedValueParameter<ItemList<ExtendedConstraint>>(ExtendedConstraintsParameterName, "", new ItemList<ExtendedConstraint>())); 108 119 } 109 120 … … 164 175 165 176 var quality = Calculate(interpreter, tree, estimationLimits.Lower, estimationLimits.Upper, problemData, rows, 166 BoundsEstimator, UseSoftConstraints, PenalityFactor );177 BoundsEstimator, UseSoftConstraints, PenalityFactor, ExtendedConstraints); 167 178 QualityParameter.ActualValue = new DoubleValue(quality); 168 179 … … 176 187 IRegressionProblemData problemData, IEnumerable<int> rows, 177 188 IBoundsEstimator estimator, 178 bool useSoftConstraints = false, double penaltyFactor = 1.0) { 189 bool useSoftConstraints = false, double penaltyFactor = 1.0, 190 IEnumerable<ExtendedConstraint> extendedConstraints = null) { 179 191 180 192 var estimatedValues = interpreter.GetSymbolicExpressionTreeValues(tree, problemData.Dataset, rows); … … 225 237 var nmse = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree, 226 238 EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, 227 problemData, rows, BoundsEstimator, UseSoftConstraints, PenalityFactor );239 problemData, rows, BoundsEstimator, UseSoftConstraints, PenalityFactor, ExtendedConstraints); 228 240 229 241 SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = null;
Note: See TracChangeset
for help on using the changeset viewer.