Changeset 18033
- Timestamp:
- 07/27/21 14:23:28 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/RegressionProblemDataConverter.cs
r18031 r18033 171 171 172 172 private void SetVariableRanges(dynamic regressionProblemData, DoubleMatrixJsonItem item) { 173 // TODO 174 if (item != null) { 175 object variableRanges = (object)regressionProblemData.VariableRanges; //IRegressionProblemData.cs 176 IntervalCollection collection = new IntervalCollection(); 173 if (item != null) { 174 IntervalCollection variableRanges = (IntervalCollection)regressionProblemData.VariableRanges; 175 176 foreach(var kvp in variableRanges.GetDictionary()) { 177 variableRanges.DeleteInterval(kvp.Key); 178 } 179 177 180 int count = 0; 178 181 foreach (var column in item.ColumnNames) { 179 collection.AddInterval(column, new Interval(item.Value[count].Min(), item.Value[count].Max())); 182 var doubleValuesForColumn = item.Value[count]; 183 if (doubleValuesForColumn.Any(x => double.IsNaN(x))) // add a NaN interval if any NaN value exists 184 variableRanges.AddInterval(column, new Interval(double.NaN, double.NaN)); 185 else 186 variableRanges.AddInterval(column, new Interval(doubleValuesForColumn.Min(), doubleValuesForColumn.Max())); 180 187 count++; 181 188 } 182 183 var variableRangesInfo = regressionProblemData.GetType().GetField(VariableRanges, flags);184 variableRangesInfo.SetValue(regressionProblemData, collection);185 189 } 186 190 }
Note: See TracChangeset
for help on using the changeset viewer.