Changeset 16930
- Timestamp:
- 05/08/19 15:57:35 (5 years ago)
- Location:
- branches/2971_named_intervals
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Views/3.4/IntervalCollectionView.Designer.cs
r16904 r16930 90 90 #endregion 91 91 92 pr otectedSystem.Windows.Forms.DataGridView dataGridView;92 private System.Windows.Forms.DataGridView dataGridView; 93 93 private System.Windows.Forms.GroupBox groupBox1; 94 94 } -
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs
r16904 r16930 107 107 public IntervalCollection VariableRanges { 108 108 get => VariableRangesParameter.Value; 109 set => VariableRanges = value ?? throw new ArgumentNullException("Variable Ranges", "The given variable ranges are null");110 109 } 111 110 … … 115 114 public ProblemDataConstraint IntervalConstraints { 116 115 get => IntervalConstraintsParameter.Value; 117 set => IntervalConstraints = value ?? throw new ArgumentNullException("IntervalCosntraint", "The given Constraint is null.");118 116 } 119 117 … … 147 145 private void AfterDeserialization() { 148 146 if (!Parameters.ContainsKey(VariableRangesParameterName)) { 149 var variables = InputVariables.Select(x => x.AsReadOnly()).ToList(); 150 IntervalCollection intervalCollection = new IntervalCollection(); 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 intervalCollection.VariableIntervals.Add(variable.Value, variableInterval); 155 } 156 147 var intervalCollection = CalculateDatasetIntervals(this.Dataset); 157 148 Parameters.Add(new FixedValueParameter<IntervalCollection>(VariableRangesParameterName, intervalCollection)); 158 149 } … … 187 178 var variables = InputVariables.Select(x => x.AsReadOnly()).ToList(); 188 179 Parameters.Add(new ConstrainedValueParameter<StringValue>(TargetVariableParameterName, new ItemSet<StringValue>(variables), variables.Where(x => x.Value == targetVariable).First())); 189 190 IntervalCollection intervalCollection = new IntervalCollection(); 191 foreach (var variable in variables) { 192 if (!dataset.DoubleVariables.Contains(variable.Value)) continue; // intervals are only possible for double variables 193 var variableInterval = Interval.GetInterval(dataset.GetDoubleValues(variable.Value)); 194 intervalCollection.VariableIntervals.Add(variable.Value, variableInterval); 195 } 196 180 var intervalCollection = CalculateDatasetIntervals(this.Dataset); 197 181 Parameters.Add(new FixedValueParameter<IntervalCollection>(VariableRangesParameterName, intervalCollection)); 198 182 Parameters.Add(new FixedValueParameter<ProblemDataConstraint>(IntervalConstraintsParameterName, new ProblemDataConstraint(this))); … … 200 184 } 201 185 186 private static IntervalCollection CalculateDatasetIntervals(IDataset dataset) { 187 IntervalCollection intervalCollection = new IntervalCollection(); 188 foreach (var variable in dataset.DoubleVariables) {// intervals are only possible for double variables 189 var variableInterval = Interval.GetInterval(dataset.GetDoubleValues(variable)); 190 intervalCollection.AddInterval(variable, variableInterval); 191 } 192 193 return intervalCollection; 194 } 195 202 196 private void RegisterParameterEvents() { 203 197 TargetVariableParameter.ValueChanged += new EventHandler(TargetVariableParameter_ValueChanged); -
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionProblemData.cs
r16904 r16930 28 28 string TargetVariable { get; set; } 29 29 30 IntervalCollection VariableRanges { get; set;}31 ProblemDataConstraint IntervalConstraints { get; set;}30 IntervalCollection VariableRanges { get;} 31 ProblemDataConstraint IntervalConstraints { get; } 32 32 33 33 IEnumerable<double> TargetVariableValues { get; }
Note: See TracChangeset
for help on using the changeset viewer.