Changeset 16407 for trunk/HeuristicLab.Problems.DataAnalysis
- Timestamp:
- 12/19/18 14:50:56 (6 years ago)
- Location:
- trunk/HeuristicLab.Problems.DataAnalysis
- Files:
-
- 3 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/HeuristicLab.Problems.DataAnalysis
- Property svn:mergeinfo changed
/branches/2966_interval_calculation/HeuristicLab.Problems.DataAnalysis (added) merged: 16320,16322-16323,16326-16327,16363-16364,16383,16404,16406
- Property svn:mergeinfo changed
-
trunk/HeuristicLab.Problems.DataAnalysis/3.4/DatasetUtil.cs
r15583 r16407 93 93 } 94 94 95 public static Dictionary<string, Interval> GetVariableRanges(IDataset dataset, IEnumerable<int> rows = null) { 96 Dictionary<string, Interval> variableRanges = new Dictionary<string, Interval>(); 97 98 foreach (var variable in dataset.VariableNames) { 99 IEnumerable<double> values = null; 100 101 if (rows == null) values = dataset.GetDoubleValues(variable); 102 else values = dataset.GetDoubleValues(variable, rows); 103 104 var range = Interval.GetInterval(values); 105 variableRanges.Add(variable, range); 106 } 107 108 return variableRanges; 109 } 110 95 111 private static bool GetEqualValues(this Dictionary<ValuesType, ValuesType> variableValuesMapping, ValuesType originalValues, out ValuesType matchingValues) { 96 112 if (variableValuesMapping.ContainsKey(originalValues)) { -
trunk/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj
r15638 r16407 140 140 <Compile Include="Implementation\ConstantModel.cs" /> 141 141 <Compile Include="Implementation\DataAnalysisModel.cs" /> 142 <Compile Include="Implementation\Interval.cs" /> 142 143 <Compile Include="Implementation\Regression\ConfidenceBoundRegressionSolution.cs" /> 143 144 <Compile Include="Implementation\Regression\ConstantRegressionModel.cs" /> -
trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval.cs
r16405 r16407 54 54 55 55 public static Interval GetInterval(IEnumerable<double> values) { 56 if (values == null) throw new ArgumentNullException(" The given value set is not defined.");57 if (!values.Any()) throw new ArgumentException($"No val id values are present.");56 if (values == null) throw new ArgumentNullException("values"); 57 if (!values.Any()) throw new ArgumentException($"No values are present."); 58 58 59 59 var min = double.MaxValue; … … 76 76 return false; 77 77 78 return this.UpperBound.IsAlmost(other.UpperBound) && this.LowerBound.IsAlmost(other.LowerBound); 78 return (UpperBound.IsAlmost(other.UpperBound) || (double.IsNaN(UpperBound) && double.IsNaN(other.UpperBound))) 79 && (LowerBound.IsAlmost(other.LowerBound) || (double.IsNaN(LowerBound) && double.IsNaN(other.LowerBound))); 79 80 } 80 81
Note: See TracChangeset
for help on using the changeset viewer.