Changeset 10191
- Timestamp:
- 12/04/13 15:22:40 (11 years ago)
- Location:
- branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/PreprocessingData.cs
r10189 r10191 157 157 } 158 158 159 public bool IsMissingValue(string variableName, int rowIndex) { 160 if (IsType<double>(variableName)) { 161 return double.IsNaN(GetCell<double>(variableName, rowIndex)); 162 } else if (IsType<string>(variableName)) { 163 return string.IsNullOrEmpty(GetCell<string>(variableName, rowIndex)); 164 } else if (IsType<DateTime>(variableName)) { 165 return GetCell<DateTime>(variableName, rowIndex).Equals(DateTime.MinValue); 166 } else { 167 throw new ArgumentException("cell in column with variableName: " + variableName + " and row index " + rowIndex + " contains a non supported type."); 168 } 169 } 170 159 171 public IEnumerable<int> GetMissingValueIndices(string variableName) { 160 172 if (IsType<double>(variableName)) { … … 165 177 return GetValues<DateTime>(variableName).Select((s, i) => new { i, s }).Where(t => t.s.Equals(DateTime.MinValue)).Select(t => t.i); 166 178 } else { 167 throw new ArgumentException("column with index: " + variableName + " contains a non supported type.");179 throw new ArgumentException("column with variableName: " + variableName + " contains a non supported type."); 168 180 } 169 181 } -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/StatisticInfo.cs
r10189 r10191 91 91 return preprocessingData.GetValues<T>(variableName).GroupBy(x => x).Count(); 92 92 } 93 94 public int GetRowMissingValueCount(int rowIndex) { 95 int count = 0; 96 foreach (var variableName in preprocessingData.VariableNames) { 97 if (preprocessingData.IsMissingValue(variableName, rowIndex)) { 98 ++count; 99 } 100 } 101 return count; 102 } 93 103 } 94 104 } -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IPreprocessingData.cs
r10189 r10191 59 59 /// <returns></returns> 60 60 IEnumerable<int> GetMissingValueIndices(string variableName); 61 62 bool IsMissingValue(string variableName, int rowIndex); 61 63 } 62 64 } -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IStatisticInfo.cs
r10183 r10191 10 10 int GetMissingValueCount(); 11 11 int GetMissingValueCount(string variableName); 12 int GetRowMissingValueCount(int rowIndex); 12 13 T GetMin<T>(string variableName) where T : IComparable<T>; 13 14 T GetMax<T>(string variableName) where T : IComparable<T>;
Note: See TracChangeset
for help on using the changeset viewer.