Changeset 16884
- Timestamp:
- 05/02/19 12:01:12 (6 years ago)
- Location:
- branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs
r16841 r16884 146 146 [StorableHook(HookType.AfterDeserialization)] 147 147 private void AfterDeserialization() { 148 var variables = InputVariables.Select(x => x.AsReadOnly()).ToList(); 149 NamedIntervals namedIntervals = new NamedIntervals(); 150 foreach (var variable in variables) { 151 if (!this.Dataset.DoubleVariables.Contains(variable.Value)) continue; // intervals are only possible for double variables 152 var variableInterval = Interval.GetInterval(this.Dataset.GetDoubleValues(variable.Value)); 153 namedIntervals.VariableIntervals.Add(variable.Value, variableInterval); 154 } 155 156 Parameters.Add(new FixedValueParameter<NamedIntervals>(VariableRangesParameterName, namedIntervals)); 157 Parameters.Add(new FixedValueParameter<ParsedConstraint>(IntervalConstraintsParameterName, new ParsedConstraint(this))); 148 if (!Parameters.ContainsKey(VariableRangesParameterName)) { 149 var variables = InputVariables.Select(x => x.AsReadOnly()).ToList(); 150 NamedIntervals namedIntervals = new NamedIntervals(); 151 foreach (var variable in variables) { 152 if (!this.Dataset.DoubleVariables.Contains(variable.Value)) continue; // intervals are only possible for double variables 153 var variableInterval = Interval.GetInterval(this.Dataset.GetDoubleValues(variable.Value)); 154 namedIntervals.VariableIntervals.Add(variable.Value, variableInterval); 155 } 156 157 Parameters.Add(new FixedValueParameter<NamedIntervals>(VariableRangesParameterName, namedIntervals)); 158 } 159 if (!Parameters.ContainsKey(IntervalConstraintsParameterName)) { 160 Parameters.Add(new FixedValueParameter<ParsedConstraint>(IntervalConstraintsParameterName, new ParsedConstraint(this))); 161 } 158 162 RegisterParameterEvents(); 159 163 } -
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/ParsedConstraint.cs
r16881 r16884 31 31 [Item("ParsedConstraint", "Represents parsed constraints.")] 32 32 public class ParsedConstraint : Item { 33 private static readonly string exampleInput = "# Example for a target variable constraint:" + Environment.NewLine +33 private static readonly string exampleInput = "# Example for a target variable constraint:" + Environment.NewLine + 34 34 "Target:'y' in [0 .. 100]" + Environment.NewLine + Environment.NewLine + 35 "# Example for constraint on model parameter: " + Environment.NewLine +35 "# Example for constraint on model parameter: " + Environment.NewLine + 36 36 "d'y'/d'x' in [0 .. 10]" + Environment.NewLine + 37 37 "\u2202²'y'/\u2202'x'² in ]-1 .. inf.["; 38 38 39 [Storable] 39 40 public string Input { get; set; } 40 41 41 42 private IEnumerable<IntervalConstraint> constraints; 43 [Storable] 42 44 public IEnumerable<IntervalConstraint> Constraints { 43 45 get => constraints; … … 46 48 OnChanged(EventArgs.Empty); 47 49 } 48 } 49 public IRegressionProblemData ProblemData { get; set; } 50 } 51 [Storable] 52 public IRegressionProblemData ProblemData { get; private set; } 50 53 51 54 [StorableConstructor]
Note: See TracChangeset
for help on using the changeset viewer.