- Timestamp:
- 04/09/14 13:08:49 (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/ManipulationLogic.cs
r10718 r10737 299 299 List<int> rows= new List<int>(); 300 300 301 for (int i = preprocessingData.Rows - 1; i >= 0; --i)301 for (int i = 0; i < preprocessingData.Rows; ++i) 302 302 { 303 303 int missingCount = statisticsLogic.GetRowMissingValueCount(i); 304 if (100f / preprocessingData.Columns * missingCount > =percent)304 if (100f / preprocessingData.Columns * missingCount > percent) 305 305 { 306 306 rows.Add(i); … … 314 314 315 315 List<int> columns = new List<int>(); 316 for (int i = preprocessingData.Columns - 1; i >= 0; --i) 317 { 316 for (int i = 0; i < preprocessingData.Columns; ++i) { 318 317 int missingCount = statisticsLogic.GetMissingValueCount(i); 319 if (100f / preprocessingData.Columns * missingCount >= percent) 320 { 318 if (100f / preprocessingData.Rows * missingCount > percent) { 321 319 columns.Add(i); 322 320 } … … 329 327 330 328 List<int> columns = new List<int>(); 331 for (int i = preprocessingData.Columns - 1; i >= 0; --i) 332 { 329 for (int i = 0; i < preprocessingData.Columns; ++i) { 333 330 if (preprocessingData.IsType<double>(i) || preprocessingData.IsType<DateTime>(i)) 334 331 { … … 355 352 } 356 353 357 private void DeleteRows(IEnumerable<int> rows) { 354 private void DeleteRows(List<int> rows) { 355 rows.Sort(); 356 rows.Reverse(); 358 357 preprocessingData.InTransaction(() => 359 358 { … … 365 364 } 366 365 367 private void DeleteColumns(IEnumerable<int> columns) { 366 private void DeleteColumns(List<int> columns) { 367 columns.Sort(); 368 columns.Reverse(); 368 369 preprocessingData.InTransaction(() => 369 370 { … … 373 374 } 374 375 }); 376 } 377 378 public event DataPreprocessingChangedEventHandler Changed { 379 add { dataGridLogic.Changed += value; } 380 remove { dataGridLogic.Changed -= value; } 375 381 } 376 382 } -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/SearchLogic.cs
r10661 r10737 43 43 void preprocessingData_Changed(object sender, DataPreprocessingChangedEventArgs e) 44 44 { 45 MissingValueIndicies.Remove(e.Column); 46 ValuesWithoutNaN.Remove(e.Column); 45 switch (e.Type) { 46 case DataPreprocessingChangedEventType.DeleteColumn: 47 case DataPreprocessingChangedEventType.ChangeColumn: 48 MissingValueIndicies.Remove(e.Column); 49 ValuesWithoutNaN.Remove(e.Column); 50 break; 51 case DataPreprocessingChangedEventType.AddColumn: 52 //cache does not need to be updated, will be calculated the first time it is requested 53 break; 54 case DataPreprocessingChangedEventType.DeleteRow: 55 case DataPreprocessingChangedEventType.AddRow: 56 case DataPreprocessingChangedEventType.ChangeItem: 57 case DataPreprocessingChangedEventType.Any: 58 case DataPreprocessingChangedEventType.Transformation: 59 MissingValueIndicies = new Dictionary<int, IEnumerable<int>>(); 60 ValuesWithoutNaN = new Dictionary<int, IEnumerable>(); 61 break; 62 } 47 63 } 48 64
Note: See TracChangeset
for help on using the changeset viewer.