Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/09/14 13:08:49 (11 years ago)
Author:
rstoll
Message:
  • Preview and execution for delete columns/rows with insufficient information
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  
    299299      List<int> rows= new List<int>();
    300300
    301       for (int i = preprocessingData.Rows - 1; i >= 0; --i)
     301      for (int i = 0; i < preprocessingData.Rows; ++i)
    302302      {
    303303        int missingCount = statisticsLogic.GetRowMissingValueCount(i);
    304         if (100f / preprocessingData.Columns * missingCount >= percent)
     304        if (100f / preprocessingData.Columns * missingCount > percent)
    305305        {
    306306          rows.Add(i);
     
    314314
    315315      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) {
    318317        int missingCount = statisticsLogic.GetMissingValueCount(i);
    319         if (100f / preprocessingData.Columns * missingCount >= percent)
    320         {
     318        if (100f / preprocessingData.Rows * missingCount > percent) {
    321319          columns.Add(i);
    322320        }
     
    329327
    330328      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) {
    333330        if (preprocessingData.IsType<double>(i) || preprocessingData.IsType<DateTime>(i))
    334331        {
     
    355352    }
    356353
    357     private void DeleteRows(IEnumerable<int> rows) {
     354    private void DeleteRows(List<int> rows) {
     355      rows.Sort();
     356      rows.Reverse();
    358357      preprocessingData.InTransaction(() =>
    359358      {
     
    365364    }
    366365
    367     private void DeleteColumns(IEnumerable<int> columns) {
     366    private void DeleteColumns(List<int> columns) {
     367      columns.Sort();
     368      columns.Reverse();
    368369      preprocessingData.InTransaction(() =>
    369370      {
     
    373374        }
    374375      });
     376    }
     377
     378    public event DataPreprocessingChangedEventHandler Changed {
     379      add { dataGridLogic.Changed += value; }
     380      remove { dataGridLogic.Changed -= value; }
    375381    }
    376382  }
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/SearchLogic.cs

    r10661 r10737  
    4343    void preprocessingData_Changed(object sender, DataPreprocessingChangedEventArgs e)
    4444    {
    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      }
    4763    }
    4864
Note: See TracChangeset for help on using the changeset viewer.