Free cookie consent management tool by TermsFeed Policy Generator

Changeset 10534 for branches


Ignore:
Timestamp:
03/05/14 13:28:31 (10 years ago)
Author:
rstoll
Message:
  • StatisticsView column specific information added
Location:
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/StatisticsLogic.cs

    r10532 r10534  
    9292
    9393    public T GetMostCommonValue<T>(int columnIndex) {
     94      var t = preprocessingData.GetValues<T>(columnIndex);
     95      var t2 = t.GroupBy(x => x);
     96      var t3 = t2.Select(g => g.Key);
     97
    9498      return preprocessingData.GetValues<T>(columnIndex)
    9599
     
    153157      return "Unknown Type";
    154158    }
    155 
    156159    private IEnumerable<double> GetDateTimeAsSeconds(int columnIndex) {
    157160      return preprocessingData.GetValues<DateTime>(columnIndex).Select(x => (double)x.Ticks / TimeSpan.TicksPerSecond);
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IStatisticsLogic.cs

    r10381 r10534  
    2727    bool IsType<T>(int columnIndex);
    2828    string GetColumnTypeAsString(int columnIndex);
    29 
     29    string GetVariableName(int columnIndex);
    3030  }
    3131}
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Views/DataGridContentView.cs

    r10533 r10534  
    11
     2using System;
     3using System.Collections.Generic;
     4using System.Linq;
    25using System.Windows.Forms;
    3 using HeuristicLab.Core.Views;
     6using HeuristicLab.Data.Views;
    47using HeuristicLab.MainForm;
    58using HeuristicLab.MainForm.WindowsForms;
    6 using HeuristicLab.Problems.DataAnalysis;
    7 using HeuristicLab.Data.Views;
    8 using System.Collections.Generic;
    9 using System.Linq;
    10 using System;
    119
    1210namespace HeuristicLab.DataPreprocessing {
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Views/StatisticsView.Designer.cs

    r10367 r10534  
    130130      // dataGridView
    131131      //
     132      this.dataGridView.AllowUserToAddRows = false;
     133      this.dataGridView.AllowUserToDeleteRows = false;
     134      this.dataGridView.AllowUserToOrderColumns = true;
     135      this.dataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     136            | System.Windows.Forms.AnchorStyles.Left)
     137            | System.Windows.Forms.AnchorStyles.Right)));
    132138      this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
    133139      this.dataGridView.Location = new System.Drawing.Point(5, 117);
    134140      this.dataGridView.Name = "dataGridView";
    135       this.dataGridView.Size = new System.Drawing.Size(531, 278);
     141      this.dataGridView.ReadOnly = true;
     142      this.dataGridView.RowHeadersWidth = 80;
     143      this.dataGridView.Size = new System.Drawing.Size(530, 278);
    136144      this.dataGridView.TabIndex = 4;
     145      this.dataGridView.VirtualMode = true;
    137146      this.dataGridView.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.dataGridView_CellValueNeeded);
    138147      //
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Views/StatisticsView.cs

    r10374 r10534  
    5353      }
    5454
     55      columns[0].HeaderCell.Value = "Type";
     56      columns[1].HeaderCell.Value = "Missing Values";
     57      columns[2].HeaderCell.Value = "Min";
     58      columns[3].HeaderCell.Value = "Max";
     59      columns[4].HeaderCell.Value = "Median";
     60      columns[5].HeaderCell.Value = "Average";
     61      columns[6].HeaderCell.Value = "std. Deviation";
     62      columns[7].HeaderCell.Value = "Variance";
     63      columns[8].HeaderCell.Value = "Most Common Value";
     64      columns[9].HeaderCell.Value = "Num. diff. Values";
     65
    5566      for (int i = 0; i < logic.GetColumnCount(); ++i) {
    5667        List<string> list;
     
    7283      dataGridView.Columns.Clear();
    7384      dataGridView.Columns.AddRange(columns);
    74       dataGridView.RowCount = columnsRowsMatrix[0].Count;
     85      dataGridView.RowCount = columnsRowsMatrix.Count;
    7586
     87      for (int i = 0; i < columnsRowsMatrix.Count; ++i) {
     88        dataGridView.Rows[i].HeaderCell.Value = logic.GetVariableName(i);
     89      }
     90      dataGridView.AllowUserToResizeColumns = true;
    7691    }
    7792
     
    115130        logic.GetMin<DateTime>(columnIndex).ToString(),
    116131        logic.GetMax<DateTime>(columnIndex).ToString(),
    117         "", //median
    118         "", //average
    119         "", //standard deviation
    120         "", //variance
    121         logic.GetMostCommonValue<string>(columnIndex).ToString(),
    122         logic.GetDifferentValuesCount<string>(columnIndex).ToString()
     132        logic.GetMedianDateTime(columnIndex).ToString(),
     133        logic.GetAverageDateTime(columnIndex).ToString(),
     134        logic.GetStandardDeviation(columnIndex).ToString(),
     135        logic.GetVariance(columnIndex).ToString(), //variance
     136        logic.GetMostCommonValue<DateTime>(columnIndex).ToString(),
     137        logic.GetDifferentValuesCount<DateTime>(columnIndex).ToString()
    123138      };
    124139    }
     
    129144
    130145    private void dataGridView_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e) {
    131       if (Content != null && e.RowIndex < columnsRowsMatrix.Count && e.ColumnIndex < Content.StatisticsLogic.GetColumnCount()) {
    132         dataGridView[e.ColumnIndex, e.RowIndex].Value = columnsRowsMatrix[e.ColumnIndex][e.RowIndex];
     146      if (Content != null && e.RowIndex < columnsRowsMatrix.Count && e.ColumnIndex < columnsRowsMatrix[0].Count) {
     147        e.Value = columnsRowsMatrix[e.RowIndex][e.ColumnIndex];
    133148      }
    134149    }
Note: See TracChangeset for help on using the changeset viewer.