Free cookie consent management tool by TermsFeed Policy Generator

Changeset 12889


Ignore:
Timestamp:
08/21/15 18:28:45 (9 years ago)
Author:
bburlacu
Message:

#2467: Add 25th and 75th percentage columns to the data preprocessing statistics view

Location:
trunk/sources
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/StatisticsView.cs

    r12676 r12889  
    3333
    3434    private List<List<string>> columnsRowsMatrix;
    35     private readonly int COLUMNS = 10;
     35    private readonly int COLUMNS = 12;
    3636
    3737    public new StatisticsContent Content {
     
    8383
    8484      columnsRowsMatrix = new List<List<string>>();
    85       DataGridViewColumn[] columns = new DataGridViewColumn[10];
     85      DataGridViewColumn[] columns = new DataGridViewColumn[COLUMNS];
    8686      for (int i = 0; i < COLUMNS; ++i) {
    8787        var column = new DataGridViewTextBoxColumn();
     
    9999      columns[6].HeaderCell.Value = "std. Deviation";
    100100      columns[7].HeaderCell.Value = "Variance";
    101       columns[8].HeaderCell.Value = "Most Common Value";
    102       columns[9].HeaderCell.Value = "Num. diff. Values";
     101      columns[8].HeaderCell.Value = "25th Percentile";
     102      columns[9].HeaderCell.Value = "75th Percentile";
     103      columns[10].HeaderCell.Value = "Most Common Value";
     104      columns[11].HeaderCell.Value = "Num. diff. Values";
    103105
    104106      if (rowCount > 0) {
     
    150152        logic.GetStandardDeviation(columnIndex).ToString(),
    151153        logic.GetVariance(columnIndex).ToString(),
     154        logic.GetOneQuarterPercentile(columnIndex).ToString(),
     155        logic.GetThreeQuarterPercentile(columnIndex).ToString(),
    152156        logic.GetMostCommonValue<double>(columnIndex).ToString(),
    153157        logic.GetDifferentValuesCount<double>(columnIndex).ToString()
     
    166170        "", //standard deviation
    167171        "", //variance
     172        "", //quarter percentile
     173        "", //three quarter percentile
    168174        logic.GetMostCommonValue<string>(columnIndex) ?? "",
    169175        logic.GetDifferentValuesCount<string>(columnIndex).ToString()
     
    178184        logic.GetMin<DateTime>(columnIndex).ToString(),
    179185        logic.GetMax<DateTime>(columnIndex).ToString(),
    180         logic.GetMedianDateTime(columnIndex).ToString(), 
     186        logic.GetMedianDateTime(columnIndex).ToString(),
    181187        logic.GetAverageDateTime(columnIndex).ToString(),
    182188        logic.GetStandardDeviation(columnIndex).ToString(),
    183189        logic.GetVariance(columnIndex).ToString(), //variance
     190        logic.GetOneQuarterPercentile(columnIndex).ToString(),
     191        logic.GetThreeQuarterPercentile(columnIndex).ToString(),
    184192        logic.GetMostCommonValue<DateTime>(columnIndex).ToString(),
    185193        logic.GetDifferentValuesCount<DateTime>(columnIndex).ToString()
  • trunk/sources/HeuristicLab.DataPreprocessing/3.4/Implementations/StatisticsLogic.cs

    r12676 r12889  
    163163    }
    164164
     165    public double GetOneQuarterPercentile(int columnIndex) {
     166      double percentile = double.NaN;
     167      if (preprocessingData.VariableHasType<double>(columnIndex)) {
     168        percentile = GetValuesWithoutNaN<double>(columnIndex).Percentile(0.25);
     169      } else if (preprocessingData.VariableHasType<DateTime>(columnIndex)) {
     170        percentile = GetDateTimeAsSeconds(columnIndex).Percentile(0.25);
     171      }
     172      return percentile;
     173    }
     174
     175    public double GetThreeQuarterPercentile(int columnIndex) {
     176      double percentile = double.NaN;
     177      if (preprocessingData.VariableHasType<double>(columnIndex)) {
     178        percentile = GetValuesWithoutNaN<double>(columnIndex).Percentile(0.75);
     179      } else if (preprocessingData.VariableHasType<DateTime>(columnIndex)) {
     180        percentile = GetDateTimeAsSeconds(columnIndex).Percentile(0.75);
     181      }
     182      return percentile;
     183    }
     184
    165185    public int GetDifferentValuesCount<T>(int columnIndex) {
    166186      return preprocessingData.GetValues<T>(columnIndex).GroupBy(x => x).Count();
  • trunk/sources/HeuristicLab.DataPreprocessing/3.4/Interfaces/IStatisticsLogic.cs

    r12012 r12889  
    4141    DateTime GetAverageDateTime(int columnIndex, bool considerSelection = false);
    4242
     43    double GetOneQuarterPercentile(int columnIndex);
     44    double GetThreeQuarterPercentile(int columnIndex);
    4345    double GetStandardDeviation(int columnIndex);
    4446    double GetVariance(int columnIndex);
Note: See TracChangeset for help on using the changeset viewer.