Changeset 7968


Ignore:
Timestamp:
06/05/12 16:39:54 (9 years ago)
Author:
sforsten
Message:

#1867:

  • Delete command for columns and for rows has been added, which have less data than a specified threshold
  • threshold can be set in a view
Location:
branches/HeuristicLab.DataImporter
Files:
5 added
6 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.DataImporter/HeuristicLab.DataImporter.Command

    • Property svn:ignore
      •  

        old new  
        11bin
        22obj
         3*.user
  • branches/HeuristicLab.DataImporter/HeuristicLab.DataImporter.Command/HeuristicLab.DataImporter.Command.csproj

    r7632 r7968  
    151151    <Compile Include="ChangeDataset\MoveColumnGroupRightCommand.cs" />
    152152    <Compile Include="ChangeDataset\MoveColumnGroupLeftCommand.cs" />
     153    <Compile Include="MissingValues\DeleteColumnsWithMissingValuesThresholdCommand.cs" />
     154    <Compile Include="MissingValues\DeleteRowsWithMissingValuesThresholdCommand.cs" />
     155    <Compile Include="MissingValues\IThresholdCommand.cs" />
    153156    <Compile Include="TimeSeries\ChangeDateTimeColumnToDoubleColumn.cs" />
    154157    <Compile Include="TimeSeries\EquidistantTimeSeriesCommandBase.cs" />
     
    190193      <DependentUpon>BoxCoxTransformationCommandView.cs</DependentUpon>
    191194    </Compile>
     195    <Compile Include="View\DeleteWithThreshold.cs">
     196      <SubType>UserControl</SubType>
     197    </Compile>
     198    <Compile Include="View\DeleteWithThreshold.Designer.cs">
     199      <DependentUpon>DeleteWithThreshold.cs</DependentUpon>
     200    </Compile>
    192201    <Compile Include="View\FilterSavitzkyGolayCommandView.cs">
    193202      <SubType>UserControl</SubType>
  • branches/HeuristicLab.DataImporter/HeuristicLab.DataImporter.Command/MissingValues/DeleteRowsWithMissingValuesCommand.cs

    r7267 r7968  
    2020#endregion
    2121
    22 using System;
    2322using System.Collections.Generic;
    2423using System.Linq;
    25 using System.Text;
    2624using HeuristicLab.DataImporter.Data;
    2725using HeuristicLab.DataImporter.Data.CommandBase;
     
    5048      base.Execute();
    5149      ColumnGroup tempColumnGroup = new ColumnGroup();
    52       Dictionary<int, object> positions = new Dictionary<int, object>();
     50      HashSet<int> positions = new HashSet<int>();
    5351      ColumnBase column;
    5452
     
    5654        column = ColumnGroup.GetColumn(AffectedColumns[col]);
    5755        for (int row = 0; row < ColumnGroup.RowCount; row++) {
    58           if (column.GetValue(row) == null && !positions.ContainsKey(row))
    59             positions[row] = null;
     56          if (column.GetValue(row) == null && !positions.Contains(row))
     57            positions.Add(row);
    6058        }
    6159      }
     
    6765
    6866      for (int i = 0; i < ColumnGroup.RowCount; i++)
    69         if (!positions.ContainsKey(i))
     67        if (!positions.Contains(i))
    7068          tempColumnGroup.AddRow(ColumnGroup.GetRow(i));
    7169
  • branches/HeuristicLab.DataImporter/HeuristicLab.DataImporter.Data/Model/ColumnGroup.cs

    r7267 r7968  
    2222using System;
    2323using System.Collections.Generic;
    24 using System.Collections;
    2524using System.Linq;
    26 using System.Text;
    2725using System.Windows.Forms;
    28 using System.Xml;
    29 using HeuristicLab.DataImporter.Data.View;
    3026using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3127
     
    5955          i++;
    6056        }
    61       }   
     57      }
    6258    }
    6359
     
    125121            selectedIndexes.Add(i);
    126122        return selectedIndexes.ToArray();
    127       }   
     123      }
    128124    }
    129125
  • branches/HeuristicLab.DataImporter/HeuristicLab.DataImporter.Data/View/ColumnGroupView.Designer.cs

    r7747 r7968  
    7474      this.lblMean = new System.Windows.Forms.Label();
    7575      this.label5 = new System.Windows.Forms.Label();
    76       this.lblMaximum = new System.Windows.Forms.Label();
    77       this.label4 = new System.Windows.Forms.Label();
    7876      this.lblMinimum = new System.Windows.Forms.Label();
    7977      this.label3 = new System.Windows.Forms.Label();
     
    8179      this.label2 = new System.Windows.Forms.Label();
    8280      this.lblValues = new System.Windows.Forms.Label();
     81      this.lblMedian = new System.Windows.Forms.Label();
     82      this.label8 = new System.Windows.Forms.Label();
     83      this.label4 = new System.Windows.Forms.Label();
     84      this.lblNullPercentage = new System.Windows.Forms.Label();
    8385      this.label6 = new System.Windows.Forms.Label();
    8486      this.label7 = new System.Windows.Forms.Label();
    8587      this.lblStdDev = new System.Windows.Forms.Label();
    86       this.lblMedian = new System.Windows.Forms.Label();
     88      this.lblMaximum = new System.Windows.Forms.Label();
    8789      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
    8890      ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
     
    165167      this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 59F));
    166168      this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 51.00671F));
    167       this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 68F));
     169      this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 95F));
    168170      this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 48.99329F));
    169171      this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0);
    170172      this.tableLayoutPanel1.Controls.Add(this.lblMean, 1, 2);
    171173      this.tableLayoutPanel1.Controls.Add(this.label5, 0, 2);
    172       this.tableLayoutPanel1.Controls.Add(this.lblMaximum, 3, 1);
    173       this.tableLayoutPanel1.Controls.Add(this.label4, 2, 1);
    174174      this.tableLayoutPanel1.Controls.Add(this.lblMinimum, 1, 1);
    175175      this.tableLayoutPanel1.Controls.Add(this.label3, 0, 1);
     
    177177      this.tableLayoutPanel1.Controls.Add(this.label2, 2, 0);
    178178      this.tableLayoutPanel1.Controls.Add(this.lblValues, 1, 0);
     179      this.tableLayoutPanel1.Controls.Add(this.lblMedian, 1, 3);
     180      this.tableLayoutPanel1.Controls.Add(this.label8, 2, 1);
     181      this.tableLayoutPanel1.Controls.Add(this.label4, 2, 2);
     182      this.tableLayoutPanel1.Controls.Add(this.lblNullPercentage, 3, 1);
    179183      this.tableLayoutPanel1.Controls.Add(this.label6, 0, 3);
    180       this.tableLayoutPanel1.Controls.Add(this.label7, 2, 2);
    181       this.tableLayoutPanel1.Controls.Add(this.lblStdDev, 3, 2);
    182       this.tableLayoutPanel1.Controls.Add(this.lblMedian, 1, 3);
     184      this.tableLayoutPanel1.Controls.Add(this.label7, 2, 3);
     185      this.tableLayoutPanel1.Controls.Add(this.lblStdDev, 3, 3);
     186      this.tableLayoutPanel1.Controls.Add(this.lblMaximum, 3, 2);
    183187      this.tableLayoutPanel1.Location = new System.Drawing.Point(-1, 20);
    184188      this.tableLayoutPanel1.Name = "tableLayoutPanel1";
     
    217221      this.label5.Text = "Mean:";
    218222      //
    219       // lblMaximum
    220       //
    221       this.lblMaximum.AutoSize = true;
    222       this.lblMaximum.Location = new System.Drawing.Point(269, 20);
    223       this.lblMaximum.Name = "lblMaximum";
    224       this.lblMaximum.Size = new System.Drawing.Size(0, 13);
    225       this.lblMaximum.TabIndex = 21;
    226       //
    227       // label4
    228       //
    229       this.label4.AutoSize = true;
    230       this.label4.Location = new System.Drawing.Point(201, 20);
    231       this.label4.Name = "label4";
    232       this.label4.Size = new System.Drawing.Size(54, 13);
    233       this.label4.TabIndex = 20;
    234       this.label4.Text = "Maximum:";
    235       //
    236223      // lblMinimum
    237224      //
     
    254241      //
    255242      this.lblNullValues.AutoSize = true;
    256       this.lblNullValues.Location = new System.Drawing.Point(269, 0);
     243      this.lblNullValues.Location = new System.Drawing.Point(282, 0);
    257244      this.lblNullValues.Name = "lblNullValues";
    258245      this.lblNullValues.Size = new System.Drawing.Size(0, 13);
     
    262249      //
    263250      this.label2.AutoSize = true;
    264       this.label2.Location = new System.Drawing.Point(201, 0);
     251      this.label2.Location = new System.Drawing.Point(187, 0);
    265252      this.label2.Name = "label2";
    266253      this.label2.Size = new System.Drawing.Size(60, 13);
     
    275262      this.lblValues.Size = new System.Drawing.Size(0, 13);
    276263      this.lblValues.TabIndex = 15;
     264      //
     265      // lblMedian
     266      //
     267      this.lblMedian.AutoSize = true;
     268      this.lblMedian.Location = new System.Drawing.Point(62, 60);
     269      this.lblMedian.Name = "lblMedian";
     270      this.lblMedian.Size = new System.Drawing.Size(0, 13);
     271      this.lblMedian.TabIndex = 25;
     272      //
     273      // label8
     274      //
     275      this.label8.AutoSize = true;
     276      this.label8.Location = new System.Drawing.Point(187, 20);
     277      this.label8.Name = "label8";
     278      this.label8.Size = new System.Drawing.Size(83, 13);
     279      this.label8.TabIndex = 28;
     280      this.label8.Text = "NullPercentage:";
     281      //
     282      // label4
     283      //
     284      this.label4.AutoSize = true;
     285      this.label4.Location = new System.Drawing.Point(187, 40);
     286      this.label4.Name = "label4";
     287      this.label4.Size = new System.Drawing.Size(54, 13);
     288      this.label4.TabIndex = 20;
     289      this.label4.Text = "Maximum:";
     290      //
     291      // lblNullPercentage
     292      //
     293      this.lblNullPercentage.AutoSize = true;
     294      this.lblNullPercentage.Location = new System.Drawing.Point(282, 20);
     295      this.lblNullPercentage.Name = "lblNullPercentage";
     296      this.lblNullPercentage.Size = new System.Drawing.Size(0, 13);
     297      this.lblNullPercentage.TabIndex = 29;
    277298      //
    278299      // label6
     
    288309      //
    289310      this.label7.AutoSize = true;
    290       this.label7.Location = new System.Drawing.Point(201, 40);
     311      this.label7.Location = new System.Drawing.Point(187, 60);
    291312      this.label7.Name = "label7";
    292313      this.label7.Size = new System.Drawing.Size(43, 13);
     
    297318      //
    298319      this.lblStdDev.AutoSize = true;
    299       this.lblStdDev.Location = new System.Drawing.Point(269, 40);
     320      this.lblStdDev.Location = new System.Drawing.Point(282, 60);
    300321      this.lblStdDev.Name = "lblStdDev";
    301322      this.lblStdDev.Size = new System.Drawing.Size(0, 13);
    302323      this.lblStdDev.TabIndex = 27;
    303324      //
    304       // lblMedian
    305       //
    306       this.lblMedian.AutoSize = true;
    307       this.lblMedian.Location = new System.Drawing.Point(62, 60);
    308       this.lblMedian.Name = "lblMedian";
    309       this.lblMedian.Size = new System.Drawing.Size(0, 13);
    310       this.lblMedian.TabIndex = 25;
     325      // lblMaximum
     326      //
     327      this.lblMaximum.AutoSize = true;
     328      this.lblMaximum.Location = new System.Drawing.Point(282, 40);
     329      this.lblMaximum.Name = "lblMaximum";
     330      this.lblMaximum.Size = new System.Drawing.Size(0, 13);
     331      this.lblMaximum.TabIndex = 21;
    311332      //
    312333      // ColumnGroupView
     
    352373    private System.Windows.Forms.Label lblStdDev;
    353374    private System.Windows.Forms.ToolTip toolTip;
     375    private System.Windows.Forms.Label label8;
     376    private System.Windows.Forms.Label lblNullPercentage;
    354377  }
    355378}
  • branches/HeuristicLab.DataImporter/HeuristicLab.DataImporter.Data/View/ColumnGroupView.cs

    r7731 r7968  
    392392      }
    393393      lblNullValues.Text = nullValuesCount.ToString();
     394      double nullPercentage = (double)nullValuesCount / (double)totalValuesCount;
     395      lblNullPercentage.Text = Double.IsNaN(nullPercentage) ? "" : nullPercentage.ToString();
    394396      lblValues.Text = totalValuesCount.ToString();
    395397      lblMinimum.Text = minimum == null ? "" : minimum.ToString();
Note: See TracChangeset for help on using the changeset viewer.