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

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

Location:
trunk/sources/HeuristicLab.DataPreprocessing/3.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 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.