Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/07/14 13:20:12 (10 years ago)
Author:
rstoll
Message:
  • Disabled menu such as average in selection and co. if selected cells are only of string columns
  • GetVariance -> using GetValuesWithoutNaN as well
Location:
branches/DataPreprocessing
Files:
3 edited

Legend:

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

    r10809 r10812  
    5454      this.mostCommonToolStripMenuItem_Column = new System.Windows.Forms.ToolStripMenuItem();
    5555      this.interpolationToolStripMenuItem_Column = new System.Windows.Forms.ToolStripMenuItem();
    56       this.smoothingToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     56      this.smoothingToolStripMenuItem_Column = new System.Windows.Forms.ToolStripMenuItem();
    5757      this.replaceValueOverSelectionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    5858      this.averageToolStripMenuItem_Selection = new System.Windows.Forms.ToolStripMenuItem();
     
    114114            this.mostCommonToolStripMenuItem_Column,
    115115            this.interpolationToolStripMenuItem_Column,
    116             this.smoothingToolStripMenuItem});
     116            this.smoothingToolStripMenuItem_Column});
    117117      this.replaceValueOverColumnToolStripMenuItem.Name = "replaceValueOverColumnToolStripMenuItem";
    118118      this.replaceValueOverColumnToolStripMenuItem.Size = new System.Drawing.Size(224, 22);
     
    156156      // smoothingToolStripMenuItem
    157157      //
    158       this.smoothingToolStripMenuItem.Name = "smoothingToolStripMenuItem";
    159       this.smoothingToolStripMenuItem.Size = new System.Drawing.Size(155, 22);
    160       this.smoothingToolStripMenuItem.Text = "Smoothing";
    161       this.smoothingToolStripMenuItem.Click += new System.EventHandler(this.ReplaceWithSmoothing_Selection_Click);
     158      this.smoothingToolStripMenuItem_Column.Name = "smoothingToolStripMenuItem";
     159      this.smoothingToolStripMenuItem_Column.Size = new System.Drawing.Size(155, 22);
     160      this.smoothingToolStripMenuItem_Column.Text = "Smoothing";
     161      this.smoothingToolStripMenuItem_Column.Click += new System.EventHandler(this.ReplaceWithSmoothing_Selection_Click);
    162162      //
    163163      // replaceValueOverSelectionToolStripMenuItem
     
    264264    private System.Windows.Forms.Button btnReplace;
    265265    private System.Windows.Forms.ToolTip toolTip;
    266     private System.Windows.Forms.ToolStripMenuItem smoothingToolStripMenuItem;
     266    private System.Windows.Forms.ToolStripMenuItem smoothingToolStripMenuItem_Column;
    267267  }
    268268}
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/DataGridContentView.cs

    r10809 r10812  
    294294            dataGridView[e.ColumnIndex, e.RowIndex].Selected = true;
    295295          }
    296           interpolationToolStripMenuItem_Column.Enabled = !(e.RowIndex == 0 || e.RowIndex == Content.Rows);
     296
    297297          var columnIndices = new HashSet<int>();
    298298          for (int i = 0; i < dataGridView.SelectedCells.Count; i++) {
    299299            columnIndices.Add(dataGridView.SelectedCells[i].ColumnIndex);
    300300          }
    301           averageToolStripMenuItem_Column.Enabled = medianToolStripMenuItem_Column.Enabled = randomToolStripMenuItem_Column.Enabled = !Content.DataGridLogic.AreAllStringColumns(columnIndices);
    302           interpolationToolStripMenuItem_Column.Enabled = interpolationToolStripMenuItem_Column.Enabled && !Content.DataGridLogic.AreAllStringColumns(columnIndices);
     301          averageToolStripMenuItem_Column.Enabled =
     302            averageToolStripMenuItem_Selection.Enabled =
     303            medianToolStripMenuItem_Column.Enabled =
     304            medianToolStripMenuItem_Selection.Enabled =
     305            randomToolStripMenuItem_Column.Enabled =
     306            randomToolStripMenuItem_Selection.Enabled = !Content.DataGridLogic.AreAllStringColumns(columnIndices);
     307
     308          smoothingToolStripMenuItem_Column.Enabled =
     309            interpolationToolStripMenuItem_Column.Enabled = !(e.RowIndex == 0 || e.RowIndex == Content.Rows)
     310            && !Content.DataGridLogic.AreAllStringColumns(columnIndices);
     311
    303312          replaceValueOverColumnToolStripMenuItem.Visible = true;
    304313          contextMenuCell.Show(MousePosition);
     
    388397
    389398    private void ReplaceWithAverage_Column_Click(object sender, EventArgs e) {
    390       Content.ManipulationLogic.ReplaceIndicesByAverageValue(GetSelectedCells(),false);
     399      Content.ManipulationLogic.ReplaceIndicesByAverageValue(GetSelectedCells(), false);
    391400    }
    392401    private void ReplaceWithAverage_Selection_Click(object sender, EventArgs e) {
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/StatisticsLogic.cs

    r10811 r10812  
    2424using System.Linq;
    2525using HeuristicLab.Common;
    26 using System.Collections;
    2726
    2827namespace HeuristicLab.DataPreprocessing {
     
    139138      double variance = double.NaN;
    140139      if (preprocessingData.IsType<double>(columnIndex)) {
    141         variance = preprocessingData.GetValues<double>(columnIndex).Variance();
     140        variance = GetValuesWithoutNaN<double>(columnIndex).Variance();
    142141      } else if (preprocessingData.IsType<DateTime>(columnIndex)) {
    143142        variance = GetDateTimeAsSeconds(columnIndex).Variance();
Note: See TracChangeset for help on using the changeset viewer.