Free cookie consent management tool by TermsFeed Policy Generator

Changeset 15285


Ignore:
Timestamp:
07/26/17 14:12:27 (7 years ago)
Author:
pfleck
Message:

#2809 removed ManipulationLogic

Location:
branches/DataPreprocessing Cleanup
Files:
1 deleted
9 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing Cleanup/HeuristicLab.DataPreprocessing.Views/3.4/DataGridContentView.Designer.cs

    r15210 r15285  
    5454      this.mostCommonToolStripMenuItem_Column = new System.Windows.Forms.ToolStripMenuItem();
    5555      this.interpolationToolStripMenuItem_Column = new System.Windows.Forms.ToolStripMenuItem();
    56       this.smoothingToolStripMenuItem_Column = new System.Windows.Forms.ToolStripMenuItem();
    5756      this.replaceValueOverSelectionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    5857      this.averageToolStripMenuItem_Selection = new System.Windows.Forms.ToolStripMenuItem();
     
    6362      this.btnReplace = new System.Windows.Forms.Button();
    6463      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
    65       this.checkInputsTargetButton = new System.Windows.Forms.Button();
    66       this.uncheckAllButton = new System.Windows.Forms.Button();
    67       this.checkAllButton = new System.Windows.Forms.Button();
     64      this.shuffleWithinPartitionsCheckBox = new System.Windows.Forms.CheckBox();
    6865      this.addRowButton = new System.Windows.Forms.Button();
    6966      this.addColumnButton = new System.Windows.Forms.Button();
    7067      this.renameColumnsButton = new System.Windows.Forms.Button();
    7168      this.showVariablesGroupBox = new System.Windows.Forms.GroupBox();
     69      this.shuffleAllButton = new System.Windows.Forms.Button();
     70      this.checkInputsTargetButton = new System.Windows.Forms.Button();
     71      this.uncheckAllButton = new System.Windows.Forms.Button();
     72      this.checkAllButton = new System.Windows.Forms.Button();
    7273      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    7374      this.contextMenuCell.SuspendLayout();
     
    127128            this.randomToolStripMenuItem_Column,
    128129            this.mostCommonToolStripMenuItem_Column,
    129             this.interpolationToolStripMenuItem_Column,
    130             this.smoothingToolStripMenuItem_Column});
     130            this.interpolationToolStripMenuItem_Column});
    131131      this.replaceValueOverColumnToolStripMenuItem.Name = "replaceValueOverColumnToolStripMenuItem";
    132132      this.replaceValueOverColumnToolStripMenuItem.Size = new System.Drawing.Size(223, 22);
     
    167167      this.interpolationToolStripMenuItem_Column.Text = "Interpolation";
    168168      this.interpolationToolStripMenuItem_Column.Click += new System.EventHandler(this.ReplaceWithInterpolation_Column_Click);
    169       //
    170       // smoothingToolStripMenuItem_Column
    171       //
    172       this.smoothingToolStripMenuItem_Column.Name = "smoothingToolStripMenuItem_Column";
    173       this.smoothingToolStripMenuItem_Column.Size = new System.Drawing.Size(155, 22);
    174       this.smoothingToolStripMenuItem_Column.Text = "Smoothing";
    175       this.smoothingToolStripMenuItem_Column.Click += new System.EventHandler(this.ReplaceWithSmoothing_Selection_Click);
    176169      //
    177170      // replaceValueOverSelectionToolStripMenuItem
     
    236229      this.btnReplace.Click += new System.EventHandler(this.btnReplace_Click);
    237230      //
     231      // shuffleWithinPartitionsCheckBox
     232      //
     233      this.shuffleWithinPartitionsCheckBox.AutoSize = true;
     234      this.shuffleWithinPartitionsCheckBox.Location = new System.Drawing.Point(444, 30);
     235      this.shuffleWithinPartitionsCheckBox.Name = "shuffleWithinPartitionsCheckBox";
     236      this.shuffleWithinPartitionsCheckBox.Size = new System.Drawing.Size(102, 17);
     237      this.shuffleWithinPartitionsCheckBox.TabIndex = 20;
     238      this.shuffleWithinPartitionsCheckBox.Text = "Within Partitions";
     239      this.toolTip.SetToolTip(this.shuffleWithinPartitionsCheckBox, "If checked, the Training and Test partitions are shuffled separately. Otherwise a" +
     240        "ll data is shuffled.");
     241      this.shuffleWithinPartitionsCheckBox.UseVisualStyleBackColor = true;
     242      //
     243      // addRowButton
     244      //
     245      this.addRowButton.Location = new System.Drawing.Point(338, 26);
     246      this.addRowButton.Name = "addRowButton";
     247      this.addRowButton.Size = new System.Drawing.Size(83, 23);
     248      this.addRowButton.TabIndex = 10;
     249      this.addRowButton.Text = "Add Datarow";
     250      this.addRowButton.UseVisualStyleBackColor = true;
     251      this.addRowButton.Click += new System.EventHandler(this.addRowButton_Click);
     252      //
     253      // addColumnButton
     254      //
     255      this.addColumnButton.Location = new System.Drawing.Point(338, 0);
     256      this.addColumnButton.Name = "addColumnButton";
     257      this.addColumnButton.Size = new System.Drawing.Size(83, 23);
     258      this.addColumnButton.TabIndex = 10;
     259      this.addColumnButton.Text = "Add Variable";
     260      this.addColumnButton.UseVisualStyleBackColor = true;
     261      this.addColumnButton.Click += new System.EventHandler(this.addColumnButton_Click);
     262      //
     263      // renameColumnsButton
     264      //
     265      this.renameColumnsButton.Location = new System.Drawing.Point(228, 26);
     266      this.renameColumnsButton.Name = "renameColumnsButton";
     267      this.renameColumnsButton.Size = new System.Drawing.Size(104, 23);
     268      this.renameColumnsButton.TabIndex = 11;
     269      this.renameColumnsButton.Text = "Rename Variables";
     270      this.renameColumnsButton.UseVisualStyleBackColor = true;
     271      this.renameColumnsButton.Click += new System.EventHandler(this.renameColumnsButton_Click);
     272      //
     273      // showVariablesGroupBox
     274      //
     275      this.showVariablesGroupBox.Controls.Add(this.checkInputsTargetButton);
     276      this.showVariablesGroupBox.Controls.Add(this.uncheckAllButton);
     277      this.showVariablesGroupBox.Controls.Add(this.checkAllButton);
     278      this.showVariablesGroupBox.Location = new System.Drawing.Point(564, 0);
     279      this.showVariablesGroupBox.Name = "showVariablesGroupBox";
     280      this.showVariablesGroupBox.Size = new System.Drawing.Size(97, 49);
     281      this.showVariablesGroupBox.TabIndex = 17;
     282      this.showVariablesGroupBox.TabStop = false;
     283      this.showVariablesGroupBox.Text = "Show Variables";
     284      //
     285      // shuffleAllButton
     286      //
     287      this.shuffleAllButton.Location = new System.Drawing.Point(444, 0);
     288      this.shuffleAllButton.Name = "shuffleAllButton";
     289      this.shuffleAllButton.Size = new System.Drawing.Size(102, 23);
     290      this.shuffleAllButton.TabIndex = 19;
     291      this.shuffleAllButton.Text = "Shuffle";
     292      this.shuffleAllButton.UseVisualStyleBackColor = true;
     293      this.shuffleAllButton.Click += new System.EventHandler(this.shuffleAllButton_Click);
     294      //
    238295      // checkInputsTargetButton
    239296      //
     
    269326      this.checkAllButton.Click += new System.EventHandler(this.checkAllButton_Click);
    270327      //
    271       // addRowButton
    272       //
    273       this.addRowButton.Location = new System.Drawing.Point(338, 26);
    274       this.addRowButton.Name = "addRowButton";
    275       this.addRowButton.Size = new System.Drawing.Size(83, 23);
    276       this.addRowButton.TabIndex = 10;
    277       this.addRowButton.Text = "Add Datarow";
    278       this.addRowButton.UseVisualStyleBackColor = true;
    279       this.addRowButton.Click += new System.EventHandler(this.addRowButton_Click);
    280       //
    281       // addColumnButton
    282       //
    283       this.addColumnButton.Location = new System.Drawing.Point(338, 0);
    284       this.addColumnButton.Name = "addColumnButton";
    285       this.addColumnButton.Size = new System.Drawing.Size(83, 23);
    286       this.addColumnButton.TabIndex = 10;
    287       this.addColumnButton.Text = "Add Variable";
    288       this.addColumnButton.UseVisualStyleBackColor = true;
    289       this.addColumnButton.Click += new System.EventHandler(this.addColumnButton_Click);
    290       //
    291       // renameColumnsButton
    292       //
    293       this.renameColumnsButton.Location = new System.Drawing.Point(228, 26);
    294       this.renameColumnsButton.Name = "renameColumnsButton";
    295       this.renameColumnsButton.Size = new System.Drawing.Size(104, 23);
    296       this.renameColumnsButton.TabIndex = 11;
    297       this.renameColumnsButton.Text = "Rename Variables";
    298       this.renameColumnsButton.UseVisualStyleBackColor = true;
    299       this.renameColumnsButton.Click += new System.EventHandler(this.renameColumnsButton_Click);
    300       //
    301       // showVariablesGroupBox
    302       //
    303       this.showVariablesGroupBox.Controls.Add(this.checkInputsTargetButton);
    304       this.showVariablesGroupBox.Controls.Add(this.uncheckAllButton);
    305       this.showVariablesGroupBox.Controls.Add(this.checkAllButton);
    306       this.showVariablesGroupBox.Location = new System.Drawing.Point(448, 0);
    307       this.showVariablesGroupBox.Name = "showVariablesGroupBox";
    308       this.showVariablesGroupBox.Size = new System.Drawing.Size(97, 49);
    309       this.showVariablesGroupBox.TabIndex = 17;
    310       this.showVariablesGroupBox.TabStop = false;
    311       this.showVariablesGroupBox.Text = "Show Variables";
    312       //
    313328      // DataGridContentView
    314329      //
    315330      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    316331      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     332      this.Controls.Add(this.shuffleWithinPartitionsCheckBox);
     333      this.Controls.Add(this.shuffleAllButton);
    317334      this.Controls.Add(this.showVariablesGroupBox);
    318335      this.Controls.Add(this.renameColumnsButton);
     
    335352      this.Controls.SetChildIndex(this.columnsTextBox, 0);
    336353      this.Controls.SetChildIndex(this.showVariablesGroupBox, 0);
     354      this.Controls.SetChildIndex(this.shuffleAllButton, 0);
     355      this.Controls.SetChildIndex(this.shuffleWithinPartitionsCheckBox, 0);
    337356      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    338357      this.contextMenuCell.ResumeLayout(false);
     
    361380    private System.Windows.Forms.Button btnReplace;
    362381    private System.Windows.Forms.ToolTip toolTip;
    363     private System.Windows.Forms.ToolStripMenuItem smoothingToolStripMenuItem_Column;
    364382    private System.Windows.Forms.Button addRowButton;
    365383    private System.Windows.Forms.Button addColumnButton;
     
    369387    private System.Windows.Forms.Button uncheckAllButton;
    370388    private System.Windows.Forms.Button checkAllButton;
     389    private System.Windows.Forms.Button shuffleAllButton;
     390    private System.Windows.Forms.CheckBox shuffleWithinPartitionsCheckBox;
    371391  }
    372392}
  • branches/DataPreprocessing Cleanup/HeuristicLab.DataPreprocessing.Views/3.4/DataGridContentView.cs

    r15274 r15285  
    248248    }
    249249
    250     private void btnApplySort_Click(object sender, System.EventArgs e) {
    251       Content.ManipulationLogic.ReOrderToIndices(virtualRowIndices);
     250    private void btnApplySort_Click(object sender, EventArgs e) {
     251      Content.ReOrderToIndices(virtualRowIndices);
    252252      OnContentChanged();
    253253    }
     
    490490          switch (findAndReplaceDialog.GetReplaceAction()) {
    491491            case ReplaceAction.Value:
    492               Content.ManipulationLogic.ReplaceIndicesByValue(cells, findAndReplaceDialog.GetReplaceText());
     492              Content.ReplaceIndicesByString(cells, findAndReplaceDialog.GetReplaceText());
    493493              break;
    494494            case ReplaceAction.Average:
    495               Content.ManipulationLogic.ReplaceIndicesByAverageValue(cells, false);
     495              Content.ReplaceIndicesByMean(cells, false);
    496496              break;
    497497            case ReplaceAction.Median:
    498               Content.ManipulationLogic.ReplaceIndicesByMedianValue(cells, false);
     498              Content.ReplaceIndicesByMedianValue(cells, false);
    499499              break;
    500500            case ReplaceAction.Random:
    501               Content.ManipulationLogic.ReplaceIndicesByRandomValue(cells, false);
     501              Content.ReplaceIndicesByRandomValue(cells, false);
    502502              break;
    503503            case ReplaceAction.MostCommon:
    504               Content.ManipulationLogic.ReplaceIndicesByMostCommonValue(cells, false);
     504              Content.ReplaceIndicesByMode(cells, false);
    505505              break;
    506506            case ReplaceAction.Interpolation:
    507               Content.ManipulationLogic.ReplaceIndicesByLinearInterpolationOfNeighbours(cells);
     507              Content.ReplaceIndicesByLinearInterpolationOfNeighbours(cells);
    508508              break;
    509509          }
     
    523523
    524524    #endregion FindAndReplaceDialog
    525 
    526525    private void dataGridView_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) {
    527526      if (Content == null) return;
     
    550549            randomToolStripMenuItem_Selection.Enabled = !Content.PreprocessingData.AreAllStringColumns(columnIndices);
    551550
    552           smoothingToolStripMenuItem_Column.Enabled =
    553             interpolationToolStripMenuItem_Column.Enabled = !dataGridView.SelectedCells.Contains(dataGridView[e.ColumnIndex, 0])
    554             && !dataGridView.SelectedCells.Contains(dataGridView[e.ColumnIndex, Content.Rows - 1])
    555             && !Content.PreprocessingData.AreAllStringColumns(columnIndices);
    556 
    557551          replaceValueOverColumnToolStripMenuItem.Visible = true;
    558552          contextMenuCell.Show(MousePosition);
     
    598592      }
    599593
    600       foreach (var selectedCell in dataGridView.SelectedCells) {
    601         var cell = (DataGridViewCell)selectedCell;
     594      foreach (DataGridViewCell cell in dataGridView.SelectedCells) {
    602595        if (!selectedCells.ContainsKey(cell.ColumnIndex))
    603           selectedCells.Add(cell.ColumnIndex, new List<int>(1024));
     596          selectedCells.Add(cell.ColumnIndex, new List<int>());
    604597        selectedCells[cell.ColumnIndex].Add(cell.RowIndex);
    605598      }
     
    608601    }
    609602
    610     private void StartReplacing() {
     603    private void ReplaceTransaction(Action action) {
    611604      SuspendRepaint();
    612     }
    613 
    614     private void StopReplacing() {
     605      action();
    615606      ResumeRepaint(true);
    616     }
    617 
    618     private void ReplaceTransaction(Action action) {
    619       StartReplacing();
    620       action();
    621       StopReplacing();
    622607    }
    623608
     
    633618
    634619    #region ContextMenu Events
    635 
    636620    private void ReplaceWithAverage_Column_Click(object sender, EventArgs e) {
    637621      ReplaceTransaction(() => {
    638         Content.ManipulationLogic.ReplaceIndicesByAverageValue(GetSelectedCells(), false);
     622        Content.ReplaceIndicesByMean(GetSelectedCells(), false);
    639623      });
    640624    }
    641625    private void ReplaceWithAverage_Selection_Click(object sender, EventArgs e) {
    642626      ReplaceTransaction(() => {
    643         Content.ManipulationLogic.ReplaceIndicesByAverageValue(GetSelectedCells(), true);
     627        Content.ReplaceIndicesByMean(GetSelectedCells(), true);
    644628      });
    645629    }
     
    647631    private void ReplaceWithMedian_Column_Click(object sender, EventArgs e) {
    648632      ReplaceTransaction(() => {
    649         Content.ManipulationLogic.ReplaceIndicesByMedianValue(GetSelectedCells(), false);
     633        Content.ReplaceIndicesByMedianValue(GetSelectedCells(), false);
    650634      });
    651635    }
    652636    private void ReplaceWithMedian_Selection_Click(object sender, EventArgs e) {
    653637      ReplaceTransaction(() => {
    654         Content.ManipulationLogic.ReplaceIndicesByMedianValue(GetSelectedCells(), true);
     638        Content.ReplaceIndicesByMedianValue(GetSelectedCells(), true);
    655639      });
    656640    }
     
    658642    private void ReplaceWithRandom_Column_Click(object sender, EventArgs e) {
    659643      ReplaceTransaction(() => {
    660         Content.ManipulationLogic.ReplaceIndicesByRandomValue(GetSelectedCells(), false);
     644        Content.ReplaceIndicesByRandomValue(GetSelectedCells(), false);
    661645      });
    662646    }
    663647    private void ReplaceWithRandom_Selection_Click(object sender, EventArgs e) {
    664648      ReplaceTransaction(() => {
    665         Content.ManipulationLogic.ReplaceIndicesByRandomValue(GetSelectedCells(), true);
     649        Content.ReplaceIndicesByRandomValue(GetSelectedCells(), true);
    666650      });
    667651    }
     
    669653    private void ReplaceWithMostCommon_Column_Click(object sender, EventArgs e) {
    670654      ReplaceTransaction(() => {
    671         Content.ManipulationLogic.ReplaceIndicesByMostCommonValue(GetSelectedCells(), false);
     655        Content.ReplaceIndicesByMode(GetSelectedCells(), false);
    672656      });
    673657    }
    674658    private void ReplaceWithMostCommon_Selection_Click(object sender, EventArgs e) {
    675659      ReplaceTransaction(() => {
    676         Content.ManipulationLogic.ReplaceIndicesByMostCommonValue(GetSelectedCells(), true);
     660        Content.ReplaceIndicesByMode(GetSelectedCells(), true);
    677661      });
    678662    }
     
    680664    private void ReplaceWithInterpolation_Column_Click(object sender, EventArgs e) {
    681665      ReplaceTransaction(() => {
    682         Content.ManipulationLogic.ReplaceIndicesByLinearInterpolationOfNeighbours(GetSelectedCells());
    683       });
    684     }
    685 
    686     private void ReplaceWithSmoothing_Selection_Click(object sender, EventArgs e) {
    687       ReplaceTransaction(() => {
    688         Content.ManipulationLogic.ReplaceIndicesBySmoothing(GetSelectedCells());
     666        Content.ReplaceIndicesByLinearInterpolationOfNeighbours(GetSelectedCells());
    689667      });
    690668    }
     
    727705      }
    728706    }
     707
     708    private void shuffleAllButton_Click(object sender, EventArgs e) {
     709      Content.Shuffle(shuffleWithinPartitionsCheckBox.Checked);
     710    }
    729711  }
    730712}
  • branches/DataPreprocessing Cleanup/HeuristicLab.DataPreprocessing.Views/3.4/DataPreprocessingView.cs

    r15283 r15285  
    4949      if (Content != null) {
    5050        var data = Content.Data;
    51         var manipulationLogic = new ManipulationLogic(data);
    5251
    5352        var viewShortcuts = new ItemList<IViewShortcut> {
    54           new DataGridContent(data, manipulationLogic),
     53          new DataGridContent(data),
    5554          new StatisticsContent(data),
    5655
     
    6362
    6463          new FilterContent(data),
    65           new ManipulationContent(data, manipulationLogic),
     64          new ManipulationContent(data),
    6665          new TransformationContent(data)
    6766        };
  • branches/DataPreprocessing Cleanup/HeuristicLab.DataPreprocessing.Views/3.4/ManipulationView.Designer.cs

    r14185 r15285  
    6262      this.txtDeleteRowsInfo = new System.Windows.Forms.TextBox();
    6363      this.label5 = new System.Windows.Forms.Label();
    64       this.tabReplaceMissingValues = new System.Windows.Forms.TabPage();
    65       this.txtReplaceValue = new System.Windows.Forms.TextBox();
    66       this.cmbVariableNames = new System.Windows.Forms.ComboBox();
    67       this.cmbReplaceWith = new System.Windows.Forms.ComboBox();
    68       this.lblValueColon = new System.Windows.Forms.Label();
    69       this.label8 = new System.Windows.Forms.Label();
    70       this.label10 = new System.Windows.Forms.Label();
    71       this.tabDataShuffle = new System.Windows.Forms.TabPage();
    72       this.shuffleSeparatelyCheckbox = new System.Windows.Forms.CheckBox();
    73       this.lblShuffleProperties = new System.Windows.Forms.Label();
    7464      this.grpBoxPreview = new System.Windows.Forms.GroupBox();
    7565      this.tabsPreview = new System.Windows.Forms.TabControl();
     
    7767      this.lblPreviewInActive = new System.Windows.Forms.Label();
    7868      this.tabPreviewDeleteColumnsInfo = new System.Windows.Forms.TabPage();
     69      this.panel1 = new System.Windows.Forms.Panel();
    7970      this.lblPreviewColumnsInfo = new System.Windows.Forms.Label();
    8071      this.tabPreviewDeleteColumnsVariance = new System.Windows.Forms.TabPage();
     72      this.panel2 = new System.Windows.Forms.Panel();
     73      this.lblPreviewColumnsVariance = new System.Windows.Forms.Label();
    8174      this.label12 = new System.Windows.Forms.Label();
    82       this.lblPreviewColumnsVariance = new System.Windows.Forms.Label();
    8375      this.tabPreviewDeleteRowsInfo = new System.Windows.Forms.TabPage();
    8476      this.lblPreviewRowsInfo = new System.Windows.Forms.Label();
    85       this.tabPreviewReplaceMissingValues = new System.Windows.Forms.TabPage();
    86       this.lblPreviewReplaceMissingValues = new System.Windows.Forms.Label();
    87       this.tabPreviewShuffle = new System.Windows.Forms.TabPage();
    88       this.lblPreviewShuffle = new System.Windows.Forms.Label();
    8977      this.label9 = new System.Windows.Forms.Label();
    90       this.panel1 = new System.Windows.Forms.Panel();
    91       this.panel2 = new System.Windows.Forms.Panel();
    9278      this.grpBoxData.SuspendLayout();
    9379      this.tabsData.SuspendLayout();
     
    9682      this.tabDataDeleteColumnsVariance.SuspendLayout();
    9783      this.tabDataDeleteRowsInfo.SuspendLayout();
    98       this.tabReplaceMissingValues.SuspendLayout();
    99       this.tabDataShuffle.SuspendLayout();
    10084      this.grpBoxPreview.SuspendLayout();
    10185      this.tabsPreview.SuspendLayout();
    10286      this.tabPreviewInactive.SuspendLayout();
    10387      this.tabPreviewDeleteColumnsInfo.SuspendLayout();
     88      this.panel1.SuspendLayout();
    10489      this.tabPreviewDeleteColumnsVariance.SuspendLayout();
     90      this.panel2.SuspendLayout();
    10591      this.tabPreviewDeleteRowsInfo.SuspendLayout();
    106       this.tabPreviewReplaceMissingValues.SuspendLayout();
    107       this.tabPreviewShuffle.SuspendLayout();
    108       this.panel1.SuspendLayout();
    109       this.panel2.SuspendLayout();
    11092      this.SuspendLayout();
    11193      //
    11294      // lstMethods
    11395      //
    114       this.lstMethods.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     96      this.lstMethods.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
    11597            | System.Windows.Forms.AnchorStyles.Right)));
    11698      this.lstMethods.FormattingEnabled = true;
    117       this.lstMethods.ItemHeight = 16;
    11899      this.lstMethods.Items.AddRange(new object[] {
    119100            "Delete Columns with insufficient Information",
    120101            "Delete Columns with insufficient Variance",
    121             "Delete Rows with insufficient Information",
    122             "Replace Missing Values",
    123             "Shuffle Data"});
    124       this.lstMethods.Location = new System.Drawing.Point(4, 4);
    125       this.lstMethods.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
     102            "Delete Rows with insufficient Information"});
     103      this.lstMethods.Location = new System.Drawing.Point(3, 3);
    126104      this.lstMethods.Name = "lstMethods";
    127       this.lstMethods.Size = new System.Drawing.Size(976, 116);
     105      this.lstMethods.Size = new System.Drawing.Size(733, 95);
    128106      this.lstMethods.Sorted = true;
    129107      this.lstMethods.TabIndex = 0;
     
    134112      this.btnApply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
    135113      this.btnApply.Enabled = false;
    136       this.btnApply.Location = new System.Drawing.Point(804, 615);
    137       this.btnApply.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
     114      this.btnApply.Location = new System.Drawing.Point(603, 500);
    138115      this.btnApply.Name = "btnApply";
    139       this.btnApply.Size = new System.Drawing.Size(172, 28);
     116      this.btnApply.Size = new System.Drawing.Size(129, 23);
    140117      this.btnApply.TabIndex = 2;
    141118      this.btnApply.Text = "Apply Manipulation";
     
    145122      // grpBoxData
    146123      //
    147       this.grpBoxData.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     124      this.grpBoxData.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
    148125            | System.Windows.Forms.AnchorStyles.Right)));
    149126      this.grpBoxData.Controls.Add(this.tabsData);
    150       this.grpBoxData.Location = new System.Drawing.Point(5, 129);
    151       this.grpBoxData.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
     127      this.grpBoxData.Location = new System.Drawing.Point(4, 105);
    152128      this.grpBoxData.Name = "grpBoxData";
    153       this.grpBoxData.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
    154       this.grpBoxData.Size = new System.Drawing.Size(976, 233);
     129      this.grpBoxData.Size = new System.Drawing.Size(732, 189);
    155130      this.grpBoxData.TabIndex = 3;
    156131      this.grpBoxData.TabStop = false;
     
    159134      // tabsData
    160135      //
    161       this.tabsData.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     136      this.tabsData.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
    162137            | System.Windows.Forms.AnchorStyles.Right)));
    163138      this.tabsData.Controls.Add(this.tabPage1);
     
    165140      this.tabsData.Controls.Add(this.tabDataDeleteColumnsVariance);
    166141      this.tabsData.Controls.Add(this.tabDataDeleteRowsInfo);
    167       this.tabsData.Controls.Add(this.tabReplaceMissingValues);
    168       this.tabsData.Controls.Add(this.tabDataShuffle);
    169142      this.tabsData.ItemSize = new System.Drawing.Size(58, 18);
    170       this.tabsData.Location = new System.Drawing.Point(8, 23);
    171       this.tabsData.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
     143      this.tabsData.Location = new System.Drawing.Point(6, 19);
    172144      this.tabsData.Name = "tabsData";
    173145      this.tabsData.SelectedIndex = 0;
    174       this.tabsData.Size = new System.Drawing.Size(959, 202);
     146      this.tabsData.Size = new System.Drawing.Size(719, 164);
    175147      this.tabsData.TabIndex = 3;
    176148      //
     
    179151      this.tabPage1.Controls.Add(this.label7);
    180152      this.tabPage1.Location = new System.Drawing.Point(4, 22);
    181       this.tabPage1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
    182153      this.tabPage1.Name = "tabPage1";
    183       this.tabPage1.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
    184       this.tabPage1.Size = new System.Drawing.Size(951, 176);
     154      this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
     155      this.tabPage1.Size = new System.Drawing.Size(711, 138);
    185156      this.tabPage1.TabIndex = 5;
    186157      this.tabPage1.Text = "tabDataInactive";
     
    191162      this.label7.AutoSize = true;
    192163      this.label7.Enabled = false;
    193       this.label7.Location = new System.Drawing.Point(4, 4);
    194       this.label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
     164      this.label7.Location = new System.Drawing.Point(3, 3);
    195165      this.label7.Name = "label7";
    196       this.label7.Size = new System.Drawing.Size(345, 17);
     166      this.label7.Size = new System.Drawing.Size(259, 13);
    197167      this.label7.TabIndex = 1;
    198168      this.label7.Text = "Please select one of the manipulation methods above";
     
    204174      this.tabDataDeleteColumnsInformation.Controls.Add(this.label1);
    205175      this.tabDataDeleteColumnsInformation.Location = new System.Drawing.Point(4, 22);
    206       this.tabDataDeleteColumnsInformation.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
    207176      this.tabDataDeleteColumnsInformation.Name = "tabDataDeleteColumnsInformation";
    208       this.tabDataDeleteColumnsInformation.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
    209       this.tabDataDeleteColumnsInformation.Size = new System.Drawing.Size(951, 176);
     177      this.tabDataDeleteColumnsInformation.Padding = new System.Windows.Forms.Padding(3);
     178      this.tabDataDeleteColumnsInformation.Size = new System.Drawing.Size(711, 138);
    210179      this.tabDataDeleteColumnsInformation.TabIndex = 0;
    211180      this.tabDataDeleteColumnsInformation.Text = "del columns info";
     
    215184      //
    216185      this.label2.AutoSize = true;
    217       this.label2.Location = new System.Drawing.Point(272, 4);
    218       this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
     186      this.label2.Location = new System.Drawing.Point(204, 3);
    219187      this.label2.Name = "label2";
    220       this.label2.Size = new System.Drawing.Size(120, 17);
     188      this.label2.Size = new System.Drawing.Size(89, 13);
    221189      this.label2.TabIndex = 5;
    222190      this.label2.Text = "% missing values.";
     
    224192      // txtDeleteColumnsInfo
    225193      //
    226       this.txtDeleteColumnsInfo.Location = new System.Drawing.Point(219, 0);
    227       this.txtDeleteColumnsInfo.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
     194      this.txtDeleteColumnsInfo.Location = new System.Drawing.Point(164, 0);
    228195      this.txtDeleteColumnsInfo.Name = "txtDeleteColumnsInfo";
    229       this.txtDeleteColumnsInfo.Size = new System.Drawing.Size(44, 22);
     196      this.txtDeleteColumnsInfo.Size = new System.Drawing.Size(34, 20);
    230197      this.txtDeleteColumnsInfo.TabIndex = 4;
    231198      this.txtDeleteColumnsInfo.TextChanged += new System.EventHandler(this.txtDeleteColumnsInfo_TextChanged);
     
    234201      //
    235202      this.label1.AutoSize = true;
    236       this.label1.Location = new System.Drawing.Point(4, 4);
    237       this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
     203      this.label1.Location = new System.Drawing.Point(3, 3);
    238204      this.label1.Name = "label1";
    239       this.label1.Size = new System.Drawing.Size(205, 17);
     205      this.label1.Size = new System.Drawing.Size(155, 13);
    240206      this.label1.TabIndex = 3;
    241207      this.label1.Text = "Delete columns with more than ";
     
    246212      this.tabDataDeleteColumnsVariance.Controls.Add(this.label4);
    247213      this.tabDataDeleteColumnsVariance.Location = new System.Drawing.Point(4, 22);
    248       this.tabDataDeleteColumnsVariance.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
    249214      this.tabDataDeleteColumnsVariance.Name = "tabDataDeleteColumnsVariance";
    250       this.tabDataDeleteColumnsVariance.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
    251       this.tabDataDeleteColumnsVariance.Size = new System.Drawing.Size(951, 176);
     215      this.tabDataDeleteColumnsVariance.Padding = new System.Windows.Forms.Padding(3);
     216      this.tabDataDeleteColumnsVariance.Size = new System.Drawing.Size(711, 138);
    252217      this.tabDataDeleteColumnsVariance.TabIndex = 1;
    253218      this.tabDataDeleteColumnsVariance.Text = "del columns variance";
     
    256221      // txtDeleteColumnsVariance
    257222      //
    258       this.txtDeleteColumnsVariance.Location = new System.Drawing.Point(305, 0);
    259       this.txtDeleteColumnsVariance.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
     223      this.txtDeleteColumnsVariance.Location = new System.Drawing.Point(229, 0);
    260224      this.txtDeleteColumnsVariance.Name = "txtDeleteColumnsVariance";
    261       this.txtDeleteColumnsVariance.Size = new System.Drawing.Size(179, 22);
     225      this.txtDeleteColumnsVariance.Size = new System.Drawing.Size(135, 20);
    262226      this.txtDeleteColumnsVariance.TabIndex = 4;
    263227      this.txtDeleteColumnsVariance.TextChanged += new System.EventHandler(this.txtDeleteColumnsVariance_TextChanged);
     
    266230      //
    267231      this.label4.AutoSize = true;
    268       this.label4.Location = new System.Drawing.Point(4, 4);
    269       this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
     232      this.label4.Location = new System.Drawing.Point(3, 3);
    270233      this.label4.Name = "label4";
    271       this.label4.Size = new System.Drawing.Size(292, 17);
     234      this.label4.Size = new System.Drawing.Size(220, 13);
    272235      this.label4.TabIndex = 3;
    273236      this.label4.Text = "Delete columns with a variance smaller than  ";
     
    279242      this.tabDataDeleteRowsInfo.Controls.Add(this.label5);
    280243      this.tabDataDeleteRowsInfo.Location = new System.Drawing.Point(4, 22);
    281       this.tabDataDeleteRowsInfo.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
    282244      this.tabDataDeleteRowsInfo.Name = "tabDataDeleteRowsInfo";
    283       this.tabDataDeleteRowsInfo.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
    284       this.tabDataDeleteRowsInfo.Size = new System.Drawing.Size(951, 176);
     245      this.tabDataDeleteRowsInfo.Padding = new System.Windows.Forms.Padding(3);
     246      this.tabDataDeleteRowsInfo.Size = new System.Drawing.Size(711, 138);
    285247      this.tabDataDeleteRowsInfo.TabIndex = 2;
    286248      this.tabDataDeleteRowsInfo.Text = "del rows info";
     
    290252      //
    291253      this.label3.AutoSize = true;
    292       this.label3.Location = new System.Drawing.Point(252, 4);
    293       this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
     254      this.label3.Location = new System.Drawing.Point(189, 3);
    294255      this.label3.Name = "label3";
    295       this.label3.Size = new System.Drawing.Size(120, 17);
     256      this.label3.Size = new System.Drawing.Size(89, 13);
    296257      this.label3.TabIndex = 8;
    297258      this.label3.Text = "% missing values.";
     
    299260      // txtDeleteRowsInfo
    300261      //
    301       this.txtDeleteRowsInfo.Location = new System.Drawing.Point(196, 0);
    302       this.txtDeleteRowsInfo.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
     262      this.txtDeleteRowsInfo.Location = new System.Drawing.Point(147, 0);
    303263      this.txtDeleteRowsInfo.Name = "txtDeleteRowsInfo";
    304       this.txtDeleteRowsInfo.Size = new System.Drawing.Size(44, 22);
     264      this.txtDeleteRowsInfo.Size = new System.Drawing.Size(34, 20);
    305265      this.txtDeleteRowsInfo.TabIndex = 7;
    306266      this.txtDeleteRowsInfo.TextChanged += new System.EventHandler(this.txtDeleteRowsInfo_TextChanged);
     
    309269      //
    310270      this.label5.AutoSize = true;
    311       this.label5.Location = new System.Drawing.Point(4, 4);
    312       this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
     271      this.label5.Location = new System.Drawing.Point(3, 3);
    313272      this.label5.Name = "label5";
    314       this.label5.Size = new System.Drawing.Size(182, 17);
     273      this.label5.Size = new System.Drawing.Size(138, 13);
    315274      this.label5.TabIndex = 6;
    316275      this.label5.Text = "Delete rows with more than ";
    317276      //
    318       // tabReplaceMissingValues
    319       //
    320       this.tabReplaceMissingValues.Controls.Add(this.txtReplaceValue);
    321       this.tabReplaceMissingValues.Controls.Add(this.cmbVariableNames);
    322       this.tabReplaceMissingValues.Controls.Add(this.cmbReplaceWith);
    323       this.tabReplaceMissingValues.Controls.Add(this.lblValueColon);
    324       this.tabReplaceMissingValues.Controls.Add(this.label8);
    325       this.tabReplaceMissingValues.Controls.Add(this.label10);
    326       this.tabReplaceMissingValues.Location = new System.Drawing.Point(4, 22);
    327       this.tabReplaceMissingValues.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
    328       this.tabReplaceMissingValues.Name = "tabReplaceMissingValues";
    329       this.tabReplaceMissingValues.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
    330       this.tabReplaceMissingValues.Size = new System.Drawing.Size(951, 176);
    331       this.tabReplaceMissingValues.TabIndex = 6;
    332       this.tabReplaceMissingValues.Text = "repl missing vals";
    333       this.tabReplaceMissingValues.UseVisualStyleBackColor = true;
    334       //
    335       // txtReplaceValue
    336       //
    337       this.txtReplaceValue.Location = new System.Drawing.Point(231, 33);
    338       this.txtReplaceValue.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
    339       this.txtReplaceValue.Name = "txtReplaceValue";
    340       this.txtReplaceValue.Size = new System.Drawing.Size(132, 22);
    341       this.txtReplaceValue.TabIndex = 2;
    342       this.txtReplaceValue.TextChanged += new System.EventHandler(this.txtReplaceValue_TextChanged);
    343       //
    344       // cmbVariableNames
    345       //
    346       this.cmbVariableNames.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
    347       this.cmbVariableNames.FormattingEnabled = true;
    348       this.cmbVariableNames.Location = new System.Drawing.Point(189, 0);
    349       this.cmbVariableNames.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
    350       this.cmbVariableNames.Name = "cmbVariableNames";
    351       this.cmbVariableNames.Size = new System.Drawing.Size(160, 24);
    352       this.cmbVariableNames.TabIndex = 1;
    353       this.cmbVariableNames.SelectedIndexChanged += new System.EventHandler(this.cmbReplaceWith_SelectedIndexChanged);
    354       //
    355       // cmbReplaceWith
    356       //
    357       this.cmbReplaceWith.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
    358       this.cmbReplaceWith.FormattingEnabled = true;
    359       this.cmbReplaceWith.Items.AddRange(new object[] {
    360             "Value",
    361             "Average",
    362             "Median",
    363             "Most Common",
    364             "Random"});
    365       this.cmbReplaceWith.Location = new System.Drawing.Point(47, 33);
    366       this.cmbReplaceWith.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
    367       this.cmbReplaceWith.Name = "cmbReplaceWith";
    368       this.cmbReplaceWith.Size = new System.Drawing.Size(160, 24);
    369       this.cmbReplaceWith.TabIndex = 1;
    370       this.cmbReplaceWith.SelectedIndexChanged += new System.EventHandler(this.cmbReplaceWith_SelectedIndexChanged);
    371       //
    372       // lblValueColon
    373       //
    374       this.lblValueColon.AutoSize = true;
    375       this.lblValueColon.Location = new System.Drawing.Point(209, 37);
    376       this.lblValueColon.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
    377       this.lblValueColon.Name = "lblValueColon";
    378       this.lblValueColon.Size = new System.Drawing.Size(12, 17);
    379       this.lblValueColon.TabIndex = 0;
    380       this.lblValueColon.Text = ":";
    381       //
    382       // label8
    383       //
    384       this.label8.AutoSize = true;
    385       this.label8.Location = new System.Drawing.Point(4, 37);
    386       this.label8.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
    387       this.label8.Name = "label8";
    388       this.label8.Size = new System.Drawing.Size(32, 17);
    389       this.label8.TabIndex = 0;
    390       this.label8.Text = "with";
    391       //
    392       // label10
    393       //
    394       this.label10.AutoSize = true;
    395       this.label10.Location = new System.Drawing.Point(4, 4);
    396       this.label10.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
    397       this.label10.Name = "label10";
    398       this.label10.Size = new System.Drawing.Size(177, 17);
    399       this.label10.TabIndex = 0;
    400       this.label10.Text = "Replace missing values for";
    401       //
    402       // tabDataShuffle
    403       //
    404       this.tabDataShuffle.Controls.Add(this.shuffleSeparatelyCheckbox);
    405       this.tabDataShuffle.Controls.Add(this.lblShuffleProperties);
    406       this.tabDataShuffle.Location = new System.Drawing.Point(4, 22);
    407       this.tabDataShuffle.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
    408       this.tabDataShuffle.Name = "tabDataShuffle";
    409       this.tabDataShuffle.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
    410       this.tabDataShuffle.Size = new System.Drawing.Size(951, 176);
    411       this.tabDataShuffle.TabIndex = 4;
    412       this.tabDataShuffle.Text = "shuffle";
    413       this.tabDataShuffle.UseVisualStyleBackColor = true;
    414       //
    415       // shuffleSeparatelyCheckbox
    416       //
    417       this.shuffleSeparatelyCheckbox.AutoSize = true;
    418       this.shuffleSeparatelyCheckbox.Location = new System.Drawing.Point(8, 2);
    419       this.shuffleSeparatelyCheckbox.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
    420       this.shuffleSeparatelyCheckbox.Name = "shuffleSeparatelyCheckbox";
    421       this.shuffleSeparatelyCheckbox.Size = new System.Drawing.Size(312, 21);
    422       this.shuffleSeparatelyCheckbox.TabIndex = 1;
    423       this.shuffleSeparatelyCheckbox.Text = "Shuffle training and test partitions separately";
    424       this.shuffleSeparatelyCheckbox.UseVisualStyleBackColor = true;
    425       //
    426       // lblShuffleProperties
    427       //
    428       this.lblShuffleProperties.AutoSize = true;
    429       this.lblShuffleProperties.Enabled = false;
    430       this.lblShuffleProperties.Location = new System.Drawing.Point(4, 4);
    431       this.lblShuffleProperties.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
    432       this.lblShuffleProperties.Name = "lblShuffleProperties";
    433       this.lblShuffleProperties.Size = new System.Drawing.Size(154, 17);
    434       this.lblShuffleProperties.TabIndex = 0;
    435       this.lblShuffleProperties.Text = "No properties available";
    436       //
    437277      // grpBoxPreview
    438278      //
    439       this.grpBoxPreview.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    440             | System.Windows.Forms.AnchorStyles.Left)
     279      this.grpBoxPreview.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
     280            | System.Windows.Forms.AnchorStyles.Left) 
    441281            | System.Windows.Forms.AnchorStyles.Right)));
    442282      this.grpBoxPreview.Controls.Add(this.tabsPreview);
    443       this.grpBoxPreview.Location = new System.Drawing.Point(5, 370);
    444       this.grpBoxPreview.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
     283      this.grpBoxPreview.Location = new System.Drawing.Point(4, 301);
    445284      this.grpBoxPreview.Name = "grpBoxPreview";
    446       this.grpBoxPreview.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
    447       this.grpBoxPreview.Size = new System.Drawing.Size(976, 238);
     285      this.grpBoxPreview.Size = new System.Drawing.Size(732, 193);
    448286      this.grpBoxPreview.TabIndex = 4;
    449287      this.grpBoxPreview.TabStop = false;
     
    452290      // tabsPreview
    453291      //
    454       this.tabsPreview.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     292      this.tabsPreview.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
    455293            | System.Windows.Forms.AnchorStyles.Right)));
    456294      this.tabsPreview.Controls.Add(this.tabPreviewInactive);
     
    458296      this.tabsPreview.Controls.Add(this.tabPreviewDeleteColumnsVariance);
    459297      this.tabsPreview.Controls.Add(this.tabPreviewDeleteRowsInfo);
    460       this.tabsPreview.Controls.Add(this.tabPreviewReplaceMissingValues);
    461       this.tabsPreview.Controls.Add(this.tabPreviewShuffle);
    462298      this.tabsPreview.ItemSize = new System.Drawing.Size(58, 18);
    463       this.tabsPreview.Location = new System.Drawing.Point(8, 23);
    464       this.tabsPreview.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
     299      this.tabsPreview.Location = new System.Drawing.Point(6, 19);
    465300      this.tabsPreview.Name = "tabsPreview";
    466301      this.tabsPreview.SelectedIndex = 0;
    467       this.tabsPreview.Size = new System.Drawing.Size(959, 207);
     302      this.tabsPreview.Size = new System.Drawing.Size(719, 168);
    468303      this.tabsPreview.TabIndex = 3;
    469304      //
     
    472307      this.tabPreviewInactive.Controls.Add(this.lblPreviewInActive);
    473308      this.tabPreviewInactive.Location = new System.Drawing.Point(4, 22);
    474       this.tabPreviewInactive.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
    475309      this.tabPreviewInactive.Name = "tabPreviewInactive";
    476       this.tabPreviewInactive.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
    477       this.tabPreviewInactive.Size = new System.Drawing.Size(951, 181);
     310      this.tabPreviewInactive.Padding = new System.Windows.Forms.Padding(3);
     311      this.tabPreviewInactive.Size = new System.Drawing.Size(711, 142);
    478312      this.tabPreviewInactive.TabIndex = 5;
    479313      this.tabPreviewInactive.Text = "inactive";
     
    483317      //
    484318      this.lblPreviewInActive.AutoSize = true;
    485       this.lblPreviewInActive.Location = new System.Drawing.Point(4, 4);
    486       this.lblPreviewInActive.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
     319      this.lblPreviewInActive.Location = new System.Drawing.Point(3, 3);
    487320      this.lblPreviewInActive.Name = "lblPreviewInActive";
    488       this.lblPreviewInActive.Size = new System.Drawing.Size(491, 51);
     321      this.lblPreviewInActive.Size = new System.Drawing.Size(361, 39);
    489322      this.lblPreviewInActive.TabIndex = 2;
    490323      this.lblPreviewInActive.Text = "Filters are active and thus manipulations cannot be applied!\r\n\r\nPlease deactive t" +
     
    496329      this.tabPreviewDeleteColumnsInfo.Controls.Add(this.panel1);
    497330      this.tabPreviewDeleteColumnsInfo.Location = new System.Drawing.Point(4, 22);
    498       this.tabPreviewDeleteColumnsInfo.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
    499331      this.tabPreviewDeleteColumnsInfo.Name = "tabPreviewDeleteColumnsInfo";
    500       this.tabPreviewDeleteColumnsInfo.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
    501       this.tabPreviewDeleteColumnsInfo.Size = new System.Drawing.Size(951, 181);
     332      this.tabPreviewDeleteColumnsInfo.Padding = new System.Windows.Forms.Padding(3);
     333      this.tabPreviewDeleteColumnsInfo.Size = new System.Drawing.Size(711, 142);
    502334      this.tabPreviewDeleteColumnsInfo.TabIndex = 0;
    503335      this.tabPreviewDeleteColumnsInfo.Text = "del columns info";
    504336      this.tabPreviewDeleteColumnsInfo.UseVisualStyleBackColor = true;
    505337      //
     338      // panel1
     339      //
     340      this.panel1.AutoScroll = true;
     341      this.panel1.Controls.Add(this.lblPreviewColumnsInfo);
     342      this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
     343      this.panel1.Location = new System.Drawing.Point(3, 3);
     344      this.panel1.Margin = new System.Windows.Forms.Padding(2);
     345      this.panel1.Name = "panel1";
     346      this.panel1.Size = new System.Drawing.Size(705, 136);
     347      this.panel1.TabIndex = 2;
     348      //
    506349      // lblPreviewColumnsInfo
    507350      //
     
    509352      this.lblPreviewColumnsInfo.Dock = System.Windows.Forms.DockStyle.Left;
    510353      this.lblPreviewColumnsInfo.Location = new System.Drawing.Point(0, 0);
    511       this.lblPreviewColumnsInfo.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
    512354      this.lblPreviewColumnsInfo.Name = "lblPreviewColumnsInfo";
    513       this.lblPreviewColumnsInfo.Size = new System.Drawing.Size(423, 17);
     355      this.lblPreviewColumnsInfo.Size = new System.Drawing.Size(318, 13);
    514356      this.lblPreviewColumnsInfo.TabIndex = 1;
    515357      this.lblPreviewColumnsInfo.Text = "{0} columns with more than {1} % missing values would be deleted";
     
    520362      this.tabPreviewDeleteColumnsVariance.Controls.Add(this.label12);
    521363      this.tabPreviewDeleteColumnsVariance.Location = new System.Drawing.Point(4, 22);
    522       this.tabPreviewDeleteColumnsVariance.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
    523364      this.tabPreviewDeleteColumnsVariance.Name = "tabPreviewDeleteColumnsVariance";
    524       this.tabPreviewDeleteColumnsVariance.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
    525       this.tabPreviewDeleteColumnsVariance.Size = new System.Drawing.Size(951, 181);
     365      this.tabPreviewDeleteColumnsVariance.Padding = new System.Windows.Forms.Padding(3);
     366      this.tabPreviewDeleteColumnsVariance.Size = new System.Drawing.Size(711, 142);
    526367      this.tabPreviewDeleteColumnsVariance.TabIndex = 1;
    527368      this.tabPreviewDeleteColumnsVariance.Text = "del columns variance";
    528369      this.tabPreviewDeleteColumnsVariance.UseVisualStyleBackColor = true;
    529370      //
    530       // label12
    531       //
    532       this.label12.AutoSize = true;
    533       this.label12.Location = new System.Drawing.Point(8, 27);
    534       this.label12.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
    535       this.label12.Name = "label12";
    536       this.label12.Size = new System.Drawing.Size(0, 17);
    537       this.label12.TabIndex = 2;
     371      // panel2
     372      //
     373      this.panel2.AutoScroll = true;
     374      this.panel2.Controls.Add(this.lblPreviewColumnsVariance);
     375      this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
     376      this.panel2.Location = new System.Drawing.Point(3, 3);
     377      this.panel2.Margin = new System.Windows.Forms.Padding(2);
     378      this.panel2.Name = "panel2";
     379      this.panel2.Size = new System.Drawing.Size(705, 136);
     380      this.panel2.TabIndex = 3;
    538381      //
    539382      // lblPreviewColumnsVariance
     
    542385      this.lblPreviewColumnsVariance.Dock = System.Windows.Forms.DockStyle.Left;
    543386      this.lblPreviewColumnsVariance.Location = new System.Drawing.Point(0, 0);
    544       this.lblPreviewColumnsVariance.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
    545387      this.lblPreviewColumnsVariance.Name = "lblPreviewColumnsVariance";
    546       this.lblPreviewColumnsVariance.Size = new System.Drawing.Size(398, 17);
     388      this.lblPreviewColumnsVariance.Size = new System.Drawing.Size(301, 13);
    547389      this.lblPreviewColumnsVariance.TabIndex = 2;
    548390      this.lblPreviewColumnsVariance.Text = "{0} columns with a variance smaller than {1} would be deleted.";
    549391      //
     392      // label12
     393      //
     394      this.label12.AutoSize = true;
     395      this.label12.Location = new System.Drawing.Point(6, 22);
     396      this.label12.Name = "label12";
     397      this.label12.Size = new System.Drawing.Size(0, 13);
     398      this.label12.TabIndex = 2;
     399      //
    550400      // tabPreviewDeleteRowsInfo
    551401      //
    552402      this.tabPreviewDeleteRowsInfo.Controls.Add(this.lblPreviewRowsInfo);
    553403      this.tabPreviewDeleteRowsInfo.Location = new System.Drawing.Point(4, 22);
    554       this.tabPreviewDeleteRowsInfo.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
    555404      this.tabPreviewDeleteRowsInfo.Name = "tabPreviewDeleteRowsInfo";
    556       this.tabPreviewDeleteRowsInfo.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
    557       this.tabPreviewDeleteRowsInfo.Size = new System.Drawing.Size(951, 181);
     405      this.tabPreviewDeleteRowsInfo.Padding = new System.Windows.Forms.Padding(3);
     406      this.tabPreviewDeleteRowsInfo.Size = new System.Drawing.Size(711, 142);
    558407      this.tabPreviewDeleteRowsInfo.TabIndex = 2;
    559408      this.tabPreviewDeleteRowsInfo.Text = "del rows info";
     
    563412      //
    564413      this.lblPreviewRowsInfo.AutoSize = true;
    565       this.lblPreviewRowsInfo.Location = new System.Drawing.Point(4, 4);
    566       this.lblPreviewRowsInfo.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
     414      this.lblPreviewRowsInfo.Location = new System.Drawing.Point(3, 3);
    567415      this.lblPreviewRowsInfo.Name = "lblPreviewRowsInfo";
    568       this.lblPreviewRowsInfo.Size = new System.Drawing.Size(400, 17);
     416      this.lblPreviewRowsInfo.Size = new System.Drawing.Size(301, 13);
    569417      this.lblPreviewRowsInfo.TabIndex = 2;
    570418      this.lblPreviewRowsInfo.Text = "{0} rows with more than {1} % missing values would be deleted";
    571       //
    572       // tabPreviewReplaceMissingValues
    573       //
    574       this.tabPreviewReplaceMissingValues.Controls.Add(this.lblPreviewReplaceMissingValues);
    575       this.tabPreviewReplaceMissingValues.Location = new System.Drawing.Point(4, 22);
    576       this.tabPreviewReplaceMissingValues.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
    577       this.tabPreviewReplaceMissingValues.Name = "tabPreviewReplaceMissingValues";
    578       this.tabPreviewReplaceMissingValues.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
    579       this.tabPreviewReplaceMissingValues.Size = new System.Drawing.Size(951, 181);
    580       this.tabPreviewReplaceMissingValues.TabIndex = 6;
    581       this.tabPreviewReplaceMissingValues.Text = "repl missing vals";
    582       this.tabPreviewReplaceMissingValues.UseVisualStyleBackColor = true;
    583       //
    584       // lblPreviewReplaceMissingValues
    585       //
    586       this.lblPreviewReplaceMissingValues.AutoSize = true;
    587       this.lblPreviewReplaceMissingValues.Location = new System.Drawing.Point(4, 4);
    588       this.lblPreviewReplaceMissingValues.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
    589       this.lblPreviewReplaceMissingValues.Name = "lblPreviewReplaceMissingValues";
    590       this.lblPreviewReplaceMissingValues.Size = new System.Drawing.Size(449, 17);
    591       this.lblPreviewReplaceMissingValues.TabIndex = 3;
    592       this.lblPreviewReplaceMissingValues.Text = "{0} cells detected with missing values which would be replaced with {1}";
    593       //
    594       // tabPreviewShuffle
    595       //
    596       this.tabPreviewShuffle.Controls.Add(this.lblPreviewShuffle);
    597       this.tabPreviewShuffle.Location = new System.Drawing.Point(4, 22);
    598       this.tabPreviewShuffle.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
    599       this.tabPreviewShuffle.Name = "tabPreviewShuffle";
    600       this.tabPreviewShuffle.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
    601       this.tabPreviewShuffle.Size = new System.Drawing.Size(951, 181);
    602       this.tabPreviewShuffle.TabIndex = 4;
    603       this.tabPreviewShuffle.Text = "shuffle";
    604       this.tabPreviewShuffle.UseVisualStyleBackColor = true;
    605       //
    606       // lblPreviewShuffle
    607       //
    608       this.lblPreviewShuffle.AutoSize = true;
    609       this.lblPreviewShuffle.Location = new System.Drawing.Point(4, 4);
    610       this.lblPreviewShuffle.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
    611       this.lblPreviewShuffle.Name = "lblPreviewShuffle";
    612       this.lblPreviewShuffle.Size = new System.Drawing.Size(337, 17);
    613       this.lblPreviewShuffle.TabIndex = 0;
    614       this.lblPreviewShuffle.Text = "Data will be shuffled randomly - preview not possible";
    615419      //
    616420      // label9
     
    621425      this.label9.TabIndex = 0;
    622426      //
    623       // panel1
    624       //
    625       this.panel1.AutoScroll = true;
    626       this.panel1.Controls.Add(this.lblPreviewColumnsInfo);
    627       this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
    628       this.panel1.Location = new System.Drawing.Point(4, 4);
    629       this.panel1.Name = "panel1";
    630       this.panel1.Size = new System.Drawing.Size(943, 173);
    631       this.panel1.TabIndex = 2;
    632       //
    633       // panel2
    634       //
    635       this.panel2.AutoScroll = true;
    636       this.panel2.Controls.Add(this.lblPreviewColumnsVariance);
    637       this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
    638       this.panel2.Location = new System.Drawing.Point(4, 4);
    639       this.panel2.Name = "panel2";
    640       this.panel2.Size = new System.Drawing.Size(943, 173);
    641       this.panel2.TabIndex = 3;
    642       //
    643427      // ManipulationView
    644428      //
    645       this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
     429      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    646430      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    647431      this.Controls.Add(this.btnApply);
     
    649433      this.Controls.Add(this.grpBoxData);
    650434      this.Controls.Add(this.lstMethods);
    651       this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
    652435      this.Name = "ManipulationView";
    653       this.Size = new System.Drawing.Size(985, 651);
     436      this.Size = new System.Drawing.Size(739, 529);
    654437      this.grpBoxData.ResumeLayout(false);
    655438      this.tabsData.ResumeLayout(false);
     
    662445      this.tabDataDeleteRowsInfo.ResumeLayout(false);
    663446      this.tabDataDeleteRowsInfo.PerformLayout();
    664       this.tabReplaceMissingValues.ResumeLayout(false);
    665       this.tabReplaceMissingValues.PerformLayout();
    666       this.tabDataShuffle.ResumeLayout(false);
    667       this.tabDataShuffle.PerformLayout();
    668447      this.grpBoxPreview.ResumeLayout(false);
    669448      this.tabsPreview.ResumeLayout(false);
     
    671450      this.tabPreviewInactive.PerformLayout();
    672451      this.tabPreviewDeleteColumnsInfo.ResumeLayout(false);
     452      this.panel1.ResumeLayout(false);
     453      this.panel1.PerformLayout();
    673454      this.tabPreviewDeleteColumnsVariance.ResumeLayout(false);
    674455      this.tabPreviewDeleteColumnsVariance.PerformLayout();
     456      this.panel2.ResumeLayout(false);
     457      this.panel2.PerformLayout();
    675458      this.tabPreviewDeleteRowsInfo.ResumeLayout(false);
    676459      this.tabPreviewDeleteRowsInfo.PerformLayout();
    677       this.tabPreviewReplaceMissingValues.ResumeLayout(false);
    678       this.tabPreviewReplaceMissingValues.PerformLayout();
    679       this.tabPreviewShuffle.ResumeLayout(false);
    680       this.tabPreviewShuffle.PerformLayout();
    681       this.panel1.ResumeLayout(false);
    682       this.panel1.PerformLayout();
    683       this.panel2.ResumeLayout(false);
    684       this.panel2.PerformLayout();
    685460      this.ResumeLayout(false);
    686461
     
    697472    private System.Windows.Forms.TabPage tabPreviewDeleteColumnsVariance;
    698473    private System.Windows.Forms.TabPage tabPreviewDeleteRowsInfo;
    699     private System.Windows.Forms.TabPage tabPreviewShuffle;
    700     private System.Windows.Forms.Label lblPreviewShuffle;
    701474    private System.Windows.Forms.TabPage tabPreviewInactive;
    702475    private System.Windows.Forms.Label lblPreviewColumnsInfo;
     
    704477    private System.Windows.Forms.Label lblPreviewColumnsVariance;
    705478    private System.Windows.Forms.Label lblPreviewRowsInfo;
    706     private System.Windows.Forms.TabPage tabPreviewReplaceMissingValues;
    707     private System.Windows.Forms.Label lblPreviewReplaceMissingValues;
    708479    private System.Windows.Forms.Label label9;
    709480    private System.Windows.Forms.TabControl tabsData;
     
    721492    private System.Windows.Forms.TextBox txtDeleteRowsInfo;
    722493    private System.Windows.Forms.Label label5;
    723     private System.Windows.Forms.TabPage tabReplaceMissingValues;
    724     private System.Windows.Forms.TextBox txtReplaceValue;
    725     private System.Windows.Forms.ComboBox cmbReplaceWith;
    726     private System.Windows.Forms.Label lblValueColon;
    727     private System.Windows.Forms.Label label10;
    728     private System.Windows.Forms.TabPage tabDataShuffle;
    729     private System.Windows.Forms.Label lblShuffleProperties;
    730     private System.Windows.Forms.ComboBox cmbVariableNames;
    731     private System.Windows.Forms.Label label8;
    732494    private System.Windows.Forms.Label lblPreviewInActive;
    733     private System.Windows.Forms.CheckBox shuffleSeparatelyCheckbox;
    734495    private System.Windows.Forms.Panel panel1;
    735496    private System.Windows.Forms.Panel panel2;
  • branches/DataPreprocessing Cleanup/HeuristicLab.DataPreprocessing.Views/3.4/ManipulationView.cs

    r15283 r15285  
    2121
    2222using System;
    23 using System.Collections.Generic;
    2423using System.Drawing;
    2524using System.Globalization;
     
    4443    public ManipulationView() {
    4544      InitializeComponent();
    46       cmbReplaceWith.SelectedIndex = 0;
    4745      tabsData.Appearance = TabAppearance.FlatButtons;
    4846      tabsData.ItemSize = new Size(0, 1);
     
    5654        () => ValidateDeleteColumnsVariance(),
    5755        () => ValidateDeleteRowsInfo(),
    58         () => ValidateReplaceWith(),
    59         () => ValidateShuffle()
    6056      };
    6157
    6258      manipulations = new Action[] {
    63         () => Content.ManipulationLogic.DeleteColumnsWithMissingValuesGreater(GetDeleteColumnsInfo()),
    64         () => Content.ManipulationLogic.DeleteColumnsWithVarianceSmaller(GetDeleteColumnsVariance()),
    65         () => Content.ManipulationLogic.DeleteRowsWithMissingValuesGreater(GetRowsColumnsInfo()),
    66         () => ReplaceMissingValues(),
    67         () => Content.ManipulationLogic.Shuffle(shuffleSeparatelyCheckbox.Checked)
     59        () => Content.DeleteColumnsWithMissingValuesGreater(GetDeleteColumnsInfo()),
     60        () => Content.DeleteColumnsWithVarianceSmaller(GetDeleteColumnsVariance()),
     61        () => Content.DeleteRowsWithMissingValuesGreater(GetRowsColumnsInfo()),
    6862      };
    6963    }
     
    7266      base.OnContentChanged();
    7367      if (Content != null) {
    74         cmbVariableNames.Items.Clear();
    75         foreach (var name in Content.ManipulationLogic.VariableNames) {
    76           cmbVariableNames.Items.Add(name);
    77         }
    78         cmbVariableNames.SelectedIndex = 0;
    7968        CheckFilters();
    8069      }
     
    8372    protected override void RegisterContentEvents() {
    8473      base.RegisterContentEvents();
    85       Content.ManipulationLogic.PreprocessingData.FilterChanged += FilterLogic_FilterChanged;
     74      Content.PreprocessingData.FilterChanged += FilterLogic_FilterChanged;
    8675    }
    8776
    8877    protected override void DeregisterContentEvents() {
    89       Content.ManipulationLogic.PreprocessingData.FilterChanged -= FilterLogic_FilterChanged;
     78      Content.PreprocessingData.FilterChanged -= FilterLogic_FilterChanged;
    9079      base.DeregisterContentEvents();
    9180    }
     
    126115    }
    127116
    128     private void ReplaceMissingValues() {
    129       var missingValuesIndices = new List<int>();
    130       var columnIndex = cmbVariableNames.SelectedIndex;
    131       var columnIndices = new Dictionary<int, IList<int>> { { columnIndex, missingValuesIndices } };
    132 
    133       for (int rowIndex = 0; rowIndex < Content.ManipulationLogic.PreprocessingData.Rows; rowIndex++)
    134         if (Content.ManipulationLogic.PreprocessingData.IsCellEmpty(columnIndex, rowIndex))
    135           missingValuesIndices.Add(rowIndex);
    136 
    137       switch (cmbReplaceWith.SelectedIndex) {
    138         case 0: //Value
    139           Content.ManipulationLogic.ReplaceIndicesByValue(columnIndices, txtReplaceValue.Text);
    140           break;
    141         case 1: //Average
    142           Content.ManipulationLogic.ReplaceIndicesByAverageValue(columnIndices);
    143           break;
    144         case 2: //Median
    145           Content.ManipulationLogic.ReplaceIndicesByMedianValue(columnIndices);
    146           break;
    147         case 3: //Most Common
    148           Content.ManipulationLogic.ReplaceIndicesByMostCommonValue(columnIndices);
    149           break;
    150         case 4: //Random
    151           Content.ManipulationLogic.ReplaceIndicesByRandomValue(columnIndices);
    152           break;
    153       }
    154     }
    155 
    156117    private void ValidateDeleteColumnsInfo() {
    157118      ValidateDoubleTextBox(txtDeleteColumnsInfo.Text);
    158119      if (btnApply.Enabled) {
    159         var filteredColumns = Content.ManipulationLogic.ColumnsWithMissingValuesGreater(GetDeleteColumnsInfo());
     120        var filteredColumns = Content.ColumnsWithMissingValuesGreater(GetDeleteColumnsInfo());
    160121        int count = filteredColumns.Count;
    161122        int columnCount = Content.PreprocessingData.Columns;
     
    167128          sb.Append(Environment.NewLine);
    168129          sb.Append("Columns: ");
    169           sb.Append(Content.ManipulationLogic.VariableNames.ElementAt(filteredColumns.ElementAt(0)));
     130          sb.Append(Content.PreprocessingData.VariableNames.ElementAt(filteredColumns.ElementAt(0)));
    170131          for (int i = 1; i < filteredColumns.Count; i++) {
    171             string columnName = Content.ManipulationLogic.VariableNames.ElementAt(filteredColumns.ElementAt(i));
     132            string columnName = Content.PreprocessingData.VariableNames.ElementAt(filteredColumns.ElementAt(i));
    172133            sb.Append(", ");
    173134            sb.Append(columnName);
     
    188149      ValidateDoubleTextBox(txtDeleteColumnsVariance.Text);
    189150      if (btnApply.Enabled) {
    190         var filteredColumns = Content.ManipulationLogic.ColumnsWithVarianceSmaller(GetDeleteColumnsVariance());
     151        var filteredColumns = Content.ColumnsWithVarianceSmaller(GetDeleteColumnsVariance());
    191152        int count = filteredColumns.Count;
    192153        int columnCount = Content.PreprocessingData.Columns;
     
    198159          sb.Append(Environment.NewLine);
    199160          sb.Append("Columns: ");
    200           sb.Append(Content.ManipulationLogic.VariableNames.ElementAt(filteredColumns.ElementAt(0)));
     161          sb.Append(Content.PreprocessingData.VariableNames.ElementAt(filteredColumns.ElementAt(0)));
    201162          for (int i = 1; i < filteredColumns.Count; i++) {
    202             string columnName = Content.ManipulationLogic.VariableNames.ElementAt(filteredColumns.ElementAt(i));
     163            string columnName = Content.PreprocessingData.VariableNames.ElementAt(filteredColumns.ElementAt(i));
    203164            sb.Append(", ");
    204165            sb.Append(columnName);
     
    219180      ValidateDoubleTextBox(txtDeleteRowsInfo.Text);
    220181      if (btnApply.Enabled) {
    221         int count = Content.ManipulationLogic.RowsWithMissingValuesGreater(GetRowsColumnsInfo()).Count;
     182        int count = Content.RowsWithMissingValuesGreater(GetRowsColumnsInfo()).Count;
    222183        int rowCount = Content.PreprocessingData.Rows;
    223184        lblPreviewRowsInfo.Text = count + " row" + (count > 1 || count == 0 ? "s" : "") + " of " + rowCount + " (" + string.Format("{0:F2}%", 100d / rowCount * count) + ") were detected with more than " + txtDeleteRowsInfo.Text + "% missing values.";
     
    230191        lblPreviewRowsInfo.Text = "Preview not possible yet - please input the limit above.";
    231192      }
    232     }
    233 
    234     private void ValidateReplaceWith() {
    235       btnApply.Enabled = false;
    236       string replaceWith = (string)cmbReplaceWith.SelectedItem;
    237       int columnIndex = cmbVariableNames.SelectedIndex;
    238 
    239       if (cmbReplaceWith.SelectedIndex == 0) {
    240         string errorMessage;
    241         string replaceValue = txtReplaceValue.Text;
    242         if (string.IsNullOrEmpty(replaceValue)) {
    243           lblPreviewReplaceMissingValues.Text = "Preview not possible yet - please input the text which will be used as replacement.";
    244         } else if (!Content.ManipulationLogic.PreprocessingData.Validate(txtReplaceValue.Text, out errorMessage, columnIndex)) {
    245           lblPreviewReplaceMissingValues.Text = "Preview not possible yet - " + errorMessage;
    246         } else {
    247           btnApply.Enabled = true;
    248         }
    249         replaceWith = "\"" + replaceValue + "\"";
    250       } else {
    251         btnApply.Enabled = true;
    252       }
    253       if (btnApply.Enabled) {
    254         int count = 0;
    255         for (int rowIndex = 0; rowIndex < Content.ManipulationLogic.PreprocessingData.Rows; rowIndex++)
    256           if (Content.ManipulationLogic.PreprocessingData.IsCellEmpty(columnIndex, rowIndex)) count++;
    257 
    258         int cellCount = Content.PreprocessingData.Rows * Content.PreprocessingData.Columns;
    259         lblPreviewReplaceMissingValues.Text = count + " cell" + (count > 1 || count == 0 ? "s" : "")
    260           + " of " + cellCount + " (" + string.Format("{0:F2}%", 100d / cellCount * count) + ") were detected with missing values which would be replaced with " + replaceWith;
    261         if (count > 0) {
    262           lblPreviewReplaceMissingValues.Text += Environment.NewLine + Environment.NewLine + "Please press the button \"Apply Manipulation\" if you wish to perform the replacement.";
    263         } else {
    264           btnApply.Enabled = false;
    265         }
    266       }
    267     }
    268 
    269     private void ValidateShuffle() {
    270       btnApply.Enabled = true;
    271       lblShuffleProperties.Enabled = false;
    272       lblShuffleProperties.Visible = false;
    273       shuffleSeparatelyCheckbox.Enabled = true;
    274       shuffleSeparatelyCheckbox.Visible = true;
    275193    }
    276194
     
    299217          lblPreviewRowsInfo.Text = "rows successfully deleted.";
    300218          break;
    301         case 3:
    302           lblPreviewReplaceMissingValues.Text = "missing values successfully replaced.";
    303           btnApply.Enabled = false;
    304           break;
    305         case 4:
    306           lblPreviewShuffle.Text = "dataset shuffled successfully.";
    307           btnApply.Enabled = false;
    308           break;
    309219      }
    310220    }
     
    331241      ValidateDeleteRowsInfo();
    332242    }
    333 
    334     private void cmbReplaceWith_SelectedIndexChanged(object sender, EventArgs e) {
    335       bool isReplaceWithValueSelected = cmbReplaceWith.SelectedIndex == 0;
    336       lblValueColon.Visible = isReplaceWithValueSelected;
    337       txtReplaceValue.Visible = isReplaceWithValueSelected;
    338       ValidateReplaceWith();
    339     }
    340 
    341     private void txtReplaceValue_TextChanged(object sender, EventArgs e) {
    342       ValidateReplaceWith();
    343     }
    344243  }
    345244}
  • branches/DataPreprocessing Cleanup/HeuristicLab.DataPreprocessing/3.4/Content/DataGridContent.cs

    r15274 r15285  
    2828using HeuristicLab.Data;
    2929using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     30using HeuristicLab.Random;
    3031
    3132namespace HeuristicLab.DataPreprocessing {
     
    3738    }
    3839
    39     [Storable]
    40     public ManipulationLogic ManipulationLogic { get; private set; }
    41 
    4240    public int Rows {
    4341      get { return PreprocessingData.Rows; }
     
    7573
    7674    #region Constructor, Cloning & Persistence
    77     public DataGridContent(IFilteredPreprocessingData preprocessingData, ManipulationLogic manipulationLogic)
     75    public DataGridContent(IFilteredPreprocessingData preprocessingData)
    7876      : base(preprocessingData) {
    79       ManipulationLogic = manipulationLogic;
    8077    }
    8178
    8279    public DataGridContent(DataGridContent original, Cloner cloner)
    8380      : base(original, cloner) {
    84       ManipulationLogic = cloner.Clone(original.ManipulationLogic);
    8581    }
    8682    public override IDeepCloneable Clone(Cloner cloner) {
     
    136132#pragma warning restore 0067
    137133    #endregion
     134
     135    #region Manipulations
     136    private void ReplaceIndicesByValue(IDictionary<int, IList<int>> cells, Func<int, double> doubleAggregator = null,
     137      Func<int, DateTime> dateTimeAggregator = null, Func<int, string> stringAggregator = null) {
     138      PreprocessingData.InTransaction(() => {
     139        foreach (var column in cells) {
     140          if (doubleAggregator != null && PreprocessingData.VariableHasType<double>(column.Key)) {
     141            var value = doubleAggregator(column.Key);
     142            foreach (int index in column.Value)
     143              PreprocessingData.SetCell<double>(column.Key, index, value);
     144          } else if (dateTimeAggregator != null && PreprocessingData.VariableHasType<DateTime>(column.Key)) {
     145            var value = dateTimeAggregator(column.Key);
     146            foreach (int index in column.Value)
     147              PreprocessingData.SetCell<DateTime>(column.Key, index, value);
     148          } else if (stringAggregator != null && PreprocessingData.VariableHasType<string>(column.Key)) {
     149            var value = stringAggregator(column.Key);
     150            foreach (int index in column.Value)
     151              PreprocessingData.SetCell<string>(column.Key, index, value);
     152          }
     153        }
     154      });
     155    }
     156
     157    private void ReplaceIndicesByValues(IDictionary<int, IList<int>> cells, Func<int, IEnumerable<double>> doubleAggregator = null,
     158      Func<int, IEnumerable<DateTime>> dateTimeAggregator = null, Func<int, IEnumerable<string>> stringAggregator = null) {
     159      PreprocessingData.InTransaction(() => {
     160        foreach (var column in cells) {
     161          if (doubleAggregator != null && PreprocessingData.VariableHasType<double>(column.Key)) {
     162            var values = doubleAggregator(column.Key);
     163            foreach (var pair in column.Value.Zip(values, (row, value) => new { row, value }))
     164              PreprocessingData.SetCell<double>(column.Key, pair.row, pair.value);
     165          } else if (dateTimeAggregator != null && PreprocessingData.VariableHasType<DateTime>(column.Key)) {
     166            var values = dateTimeAggregator(column.Key);
     167            foreach (var pair in column.Value.Zip(values, (row, value) => new { row, value }))
     168              PreprocessingData.SetCell<DateTime>(column.Key, pair.row, pair.value);
     169          } else if (stringAggregator != null && PreprocessingData.VariableHasType<string>(column.Key)) {
     170            var values = stringAggregator(column.Key);
     171            foreach (var pair in column.Value.Zip(values, (row, value) => new { row, value }))
     172              PreprocessingData.SetCell<string>(column.Key, pair.row, pair.value);
     173          }
     174        }
     175      });
     176    }
     177
     178    public void ReplaceIndicesByMean(IDictionary<int, IList<int>> cells, bool considerSelection = false) {
     179      ReplaceIndicesByValue(cells,
     180        col => PreprocessingData.GetMean<double>(col, considerSelection),
     181        col => PreprocessingData.GetMean<DateTime>(col, considerSelection));
     182    }
     183
     184    public void ReplaceIndicesByMedianValue(IDictionary<int, IList<int>> cells, bool considerSelection = false) {
     185      ReplaceIndicesByValue(cells,
     186        col => PreprocessingData.GetMedian<double>(col, considerSelection),
     187        col => PreprocessingData.GetMedian<DateTime>(col, considerSelection));
     188    }
     189
     190    public void ReplaceIndicesByMode(IDictionary<int, IList<int>> cells, bool considerSelection = false) {
     191      ReplaceIndicesByValue(cells,
     192        col => PreprocessingData.GetMode<double>(col, considerSelection),
     193        col => PreprocessingData.GetMode<DateTime>(col, considerSelection),
     194        col => PreprocessingData.GetMode<string>(col, considerSelection));
     195    }
     196
     197    public void ReplaceIndicesByRandomValue(IDictionary<int, IList<int>> cells, bool considerSelection = false) {
     198      var rand = new FastRandom();
     199      ReplaceIndicesByValues(cells,
     200        col => {
     201          double min = PreprocessingData.GetMin<double>(col, considerSelection);
     202          double max = PreprocessingData.GetMax<double>(col, considerSelection);
     203          double range = max - min;
     204          return cells[col].Select(_ => rand.NextDouble() * range + min);
     205        },
     206        col => {
     207          var min = PreprocessingData.GetMin<DateTime>(col, considerSelection);
     208          var max = PreprocessingData.GetMax<DateTime>(col, considerSelection);
     209          double range = (max - min).TotalSeconds;
     210          return cells[col].Select(_ => min + TimeSpan.FromSeconds(rand.NextDouble() * range));
     211        });
     212    }
     213
     214    public void ReplaceIndicesByString(IDictionary<int, IList<int>> cells, string value) {
     215      PreprocessingData.InTransaction(() => {
     216        foreach (var column in cells) {
     217          foreach (var rowIdx in column.Value) {
     218            PreprocessingData.SetValue(value, column.Key, rowIdx);
     219          }
     220        }
     221      });
     222    }
     223
     224
     225    public void ReplaceIndicesByLinearInterpolationOfNeighbours(IDictionary<int, IList<int>> cells) {
     226      PreprocessingData.InTransaction(() => {
     227        foreach (var column in cells) {
     228          IList<Tuple<int, int>> startEndings = GetStartAndEndingsForInterpolation(column);
     229          foreach (var tuple in startEndings) {
     230            Interpolate(column, tuple.Item1, tuple.Item2);
     231          }
     232        }
     233      });
     234    }
     235
     236    private List<Tuple<int, int>> GetStartAndEndingsForInterpolation(KeyValuePair<int, IList<int>> column) {
     237      var startEndings = new List<Tuple<int, int>>();
     238      var rowIndices = column.Value.OrderBy(x => x).ToList();
     239      var count = rowIndices.Count;
     240      int start = int.MinValue;
     241      for (int i = 0; i < count; ++i) {
     242        if (start == int.MinValue) {
     243          start = IndexOfPrevPresentValue(column.Key, rowIndices[i]);
     244        }
     245        if (i + 1 == count || (i + 1 < count && rowIndices[i + 1] - rowIndices[i] > 1)) {
     246          int next = IndexOfNextPresentValue(column.Key, rowIndices[i]);
     247          if (start > 0 && next < PreprocessingData.Rows) {
     248            startEndings.Add(new Tuple<int, int>(start, next));
     249          }
     250          start = int.MinValue;
     251        }
     252      }
     253      return startEndings;
     254    }
     255
     256    private void Interpolate(KeyValuePair<int, IList<int>> column, int prevIndex, int nextIndex) {
     257      int valuesToInterpolate = nextIndex - prevIndex;
     258
     259      if (PreprocessingData.VariableHasType<double>(column.Key)) {
     260        double prev = PreprocessingData.GetCell<double>(column.Key, prevIndex);
     261        double next = PreprocessingData.GetCell<double>(column.Key, nextIndex);
     262        double interpolationStep = (next - prev) / valuesToInterpolate;
     263
     264        for (int i = prevIndex; i < nextIndex; ++i) {
     265          double interpolated = prev + (interpolationStep * (i - prevIndex));
     266          PreprocessingData.SetCell<double>(column.Key, i, interpolated);
     267        }
     268      } else if (PreprocessingData.VariableHasType<DateTime>(column.Key)) {
     269        DateTime prev = PreprocessingData.GetCell<DateTime>(column.Key, prevIndex);
     270        DateTime next = PreprocessingData.GetCell<DateTime>(column.Key, nextIndex);
     271        double interpolationStep = (next - prev).TotalSeconds / valuesToInterpolate;
     272
     273        for (int i = prevIndex; i < nextIndex; ++i) {
     274          DateTime interpolated = prev.AddSeconds(interpolationStep * (i - prevIndex));
     275          PreprocessingData.SetCell<DateTime>(column.Key, i, interpolated);
     276        }
     277      }
     278    }
     279
     280    private int IndexOfPrevPresentValue(int columnIndex, int start) {
     281      int offset = start - 1;
     282      while (offset >= 0 && PreprocessingData.IsCellEmpty(columnIndex, offset)) {
     283        offset--;
     284      }
     285
     286      return offset;
     287    }
     288
     289    private int IndexOfNextPresentValue(int columnIndex, int start) {
     290      int offset = start + 1;
     291      while (offset < PreprocessingData.Rows && PreprocessingData.IsCellEmpty(columnIndex, offset)) {
     292        offset++;
     293      }
     294
     295      return offset;
     296    }
     297
     298    public void Shuffle(bool shuffleRangesSeparately) {
     299      var random = new FastRandom();
     300
     301      if (shuffleRangesSeparately) {
     302        var ranges = new[] { PreprocessingData.TestPartition, PreprocessingData.TrainingPartition };
     303        PreprocessingData.InTransaction(() => {
     304          // process all given ranges - e.g. TrainingPartition, TestPartition
     305          foreach (IntRange range in ranges) {
     306            var indices = Enumerable.Range(0, PreprocessingData.Rows).ToArray();
     307            var shuffledIndices = Enumerable.Range(range.Start, range.Size).Shuffle(random).ToArray();
     308            for (int i = range.Start, j = 0; i < range.End; i++, j++)
     309              indices[i] = shuffledIndices[j];
     310
     311            ReOrderToIndices(indices);
     312          }
     313        });
     314
     315      } else {
     316        PreprocessingData.InTransaction(() => {
     317          var indices = Enumerable.Range(0, PreprocessingData.Rows).ToArray();
     318          indices.ShuffleInPlace(random);
     319          ReOrderToIndices(indices);
     320        });
     321      }
     322    }
     323
     324    public void ReOrderToIndices(int[] indices) {
     325      PreprocessingData.InTransaction(() => {
     326        for (int i = 0; i < PreprocessingData.Columns; ++i) {
     327          if (PreprocessingData.VariableHasType<double>(i))
     328            ReOrderToIndices<double>(i, indices);
     329          else if (PreprocessingData.VariableHasType<string>(i))
     330            ReOrderToIndices<string>(i, indices);
     331          else if (PreprocessingData.VariableHasType<DateTime>(i))
     332            ReOrderToIndices<DateTime>(i, indices);
     333        }
     334      });
     335    }
     336
     337    private void ReOrderToIndices<T>(int columnIndex, int[] indices) {
     338      var originalData = new List<T>(PreprocessingData.GetValues<T>(columnIndex));
     339      if (indices.Length != originalData.Count) throw new InvalidOperationException("The number of provided indices does not match the values.");
     340
     341      for (int i = 0; i < indices.Length; i++) {
     342        T newValue = originalData[indices[i]];
     343        PreprocessingData.SetCell<T>(columnIndex, i, newValue);
     344      }
     345    }
     346    #endregion
    138347  }
    139348}
  • branches/DataPreprocessing Cleanup/HeuristicLab.DataPreprocessing/3.4/Content/ManipulationContent.cs

    r15274 r15285  
    2020#endregion
    2121
     22using System;
     23using System.Collections.Generic;
    2224using System.Drawing;
     25using System.Linq;
    2326using HeuristicLab.Common;
    2427using HeuristicLab.Core;
     
    3336    }
    3437
    35     [Storable]
    36     public ManipulationLogic ManipulationLogic { get; private set; }
    37 
    3838    #region Constructor, Cloning & Persistence
    39     public ManipulationContent(IFilteredPreprocessingData preprocessingData, ManipulationLogic manipulationLogic)
     39    public ManipulationContent(IFilteredPreprocessingData preprocessingData)
    4040      : base(preprocessingData) {
    41       ManipulationLogic = manipulationLogic;
    4241    }
    4342
    4443    public ManipulationContent(ManipulationContent original, Cloner cloner) :
    4544      base(original, cloner) {
    46       ManipulationLogic = cloner.Clone(original.ManipulationLogic);
    4745    }
    4846    public override IDeepCloneable Clone(Cloner cloner) {
     
    5452      : base(deserializing) { }
    5553    #endregion
     54
     55    public List<int> RowsWithMissingValuesGreater(double percent) {
     56      List<int> rows = new List<int>();
     57
     58      for (int i = 0; i < PreprocessingData.Rows; ++i) {
     59        int missingCount = PreprocessingData.GetRowMissingValueCount(i);
     60        if (100f / PreprocessingData.Columns * missingCount > percent) {
     61          rows.Add(i);
     62        }
     63      }
     64
     65      return rows;
     66    }
     67
     68    public List<int> ColumnsWithMissingValuesGreater(double percent) {
     69      List<int> columns = new List<int>();
     70      for (int i = 0; i < PreprocessingData.Columns; ++i) {
     71        int missingCount = PreprocessingData.GetMissingValueCount(i);
     72        if (100f / PreprocessingData.Rows * missingCount > percent) {
     73          columns.Add(i);
     74        }
     75      }
     76
     77      return columns;
     78    }
     79
     80    public List<int> ColumnsWithVarianceSmaller(double variance) {
     81      List<int> columns = new List<int>();
     82      for (int i = 0; i < PreprocessingData.Columns; ++i) {
     83        if (PreprocessingData.VariableHasType<double>(i)) {
     84          double columnVariance = PreprocessingData.GetVariance<double>(i);
     85          if (columnVariance < variance) {
     86            columns.Add(i);
     87          }
     88        } else if (PreprocessingData.VariableHasType<DateTime>(i)) {
     89          double columnVariance = (double)PreprocessingData.GetVariance<DateTime>(i).Ticks / TimeSpan.TicksPerSecond;
     90          if (columnVariance < variance) {
     91            columns.Add(i);
     92          }
     93        }
     94      }
     95      return columns;
     96    }
     97
     98    public void DeleteRowsWithMissingValuesGreater(double percent) {
     99      DeleteRows(RowsWithMissingValuesGreater(percent));
     100    }
     101
     102    public void DeleteColumnsWithMissingValuesGreater(double percent) {
     103      DeleteColumns(ColumnsWithMissingValuesGreater(percent));
     104    }
     105
     106    public void DeleteColumnsWithVarianceSmaller(double variance) {
     107      DeleteColumns(ColumnsWithVarianceSmaller(variance));
     108    }
     109
     110    private void DeleteRows(List<int> rows) {
     111      PreprocessingData.InTransaction(() => {
     112        foreach (int row in rows.OrderByDescending(x => x)) {
     113          PreprocessingData.DeleteRow(row);
     114        }
     115      });
     116    }
     117
     118    private void DeleteColumns(List<int> columns) {
     119      PreprocessingData.InTransaction(() => {
     120        foreach (int column in columns.OrderByDescending(x => x)) {
     121          PreprocessingData.DeleteColumn(column);
     122        }
     123      });
     124    }
    56125  }
    57126}
  • branches/DataPreprocessing Cleanup/HeuristicLab.DataPreprocessing/3.4/Data/PreprocessingData.cs

    r15283 r15285  
    151151      if (VariableHasType<double>(columnIndex)) {
    152152        double val;
    153         valid = double.TryParse(value, out val);
     153        if (string.IsNullOrWhiteSpace(value)) {
     154          val = double.NaN;
     155          valid = true;
     156        } else {
     157          valid = double.TryParse(value, out val);
     158        }
    154159        if (valid)
    155160          SetCell(columnIndex, rowIndex, val);
     
    357362      errorMessage = string.Empty;
    358363      if (VariableHasType<double>(columnIndex)) {
    359         double val;
    360         valid = double.TryParse(value, out val);
    361         if (!valid) {
    362           errorMessage = "Invalid Value (Valid Value Format: \"" + FormatPatterns.GetDoubleFormatPattern() + "\")";
     364        if (string.IsNullOrWhiteSpace(value)) {
     365          valid = true;
     366        } else {
     367          double val;
     368          valid = double.TryParse(value, out val);
     369          if (!valid) {
     370            errorMessage = "Invalid Value (Valid Value Format: \"" + FormatPatterns.GetDoubleFormatPattern() + "\")";
     371          }
    363372        }
    364373      } else if (VariableHasType<string>(columnIndex)) {
  • branches/DataPreprocessing Cleanup/HeuristicLab.DataPreprocessing/3.4/HeuristicLab.DataPreprocessing-3.4.csproj

    r15283 r15285  
    131131    <Compile Include="PreprocessingTransformator.cs" />
    132132    <Compile Include="Data\DataPreprocessingChangedEvent.cs" />
    133     <Compile Include="Logic\Filter\ComparisonFilter.cs" />
    134     <Compile Include="Logic\Filter\IFilter.cs" />
    135     <Compile Include="Logic\ManipulationLogic.cs" />
     133    <Compile Include="Filter\ComparisonFilter.cs" />
     134    <Compile Include="Filter\IFilter.cs" />
    136135    <Compile Include="Data\IPreprocessingData.cs" />
    137136    <Compile Include="Content\FilterContent.cs" />
     
    152151    <None Include="HeuristicLab.snk" />
    153152  </ItemGroup>
     153  <ItemGroup />
    154154  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    155155  <PropertyGroup>
Note: See TracChangeset for help on using the changeset viewer.