- Timestamp:
- 12/04/13 15:22:40 (11 years ago)
- Location:
- branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations
- Files:
-
- 2 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 }
Note: See TracChangeset
for help on using the changeset viewer.