Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/07/14 13:19:42 (11 years ago)
Author:
sbreuer
Message:
  • provide default value (false) for considerSelection parameter
Location:
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3
Files:
8 edited

Legend:

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

    r10809 r10811  
    3737
    3838    public DataRow CreateDataRow(string variableName, DataRowVisualProperties.DataRowChartType chartType) {
    39       IList<double> values = preprocessingData.GetValues<double>(variableName, false);
     39      IList<double> values = preprocessingData.GetValues<double>(variableName);
    4040      DataRow row = new DataRow(variableName, "", values);
    4141      row.VisualProperties.ChartType = chartType;
     
    4444
    4545    public DataRow CreateDataRowRange(string variableName,int start, int end, DataRowVisualProperties.DataRowChartType chartType) {
    46       IList<double> values = preprocessingData.GetValues<double>(variableName, false);
     46      IList<double> values = preprocessingData.GetValues<double>(variableName);
    4747      IList<double> valuesRange = new List<double>();
    4848      for (int i = 0; i < values.Count; i++) {
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/ManipulationLogic.cs

    r10809 r10811  
    104104          int countValues = 0;
    105105          if (preprocessingData.IsType<double>(column.Key)) {
    106             countValues = preprocessingData.GetValues<double>(column.Key, false).Count();
    107           } else if (preprocessingData.IsType<DateTime>(column.Key)) {
    108             countValues = preprocessingData.GetValues<DateTime>(column.Key, false).Count();
     106            countValues = preprocessingData.GetValues<double>(column.Key).Count();
     107          } else if (preprocessingData.IsType<DateTime>(column.Key)) {
     108            countValues = preprocessingData.GetValues<DateTime>(column.Key).Count();
    109109          }
    110110
     
    256256    private void reOrderToIndices<T>(int columnIndex, IList<Tuple<int, int>> indices) {
    257257
    258       List<T> originalData = new List<T>(preprocessingData.GetValues<T>(columnIndex, false));
     258      List<T> originalData = new List<T>(preprocessingData.GetValues<T>(columnIndex));
    259259
    260260      // process all columns equally
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/StatisticsLogic.cs

    r10809 r10811  
    129129      double stdDev = double.NaN;
    130130      if (preprocessingData.IsType<double>(columnIndex)) {
    131         stdDev = GetValuesWithoutNaN<double>(columnIndex, false).StandardDeviation();
     131        stdDev = GetValuesWithoutNaN<double>(columnIndex).StandardDeviation();
    132132      } else if (preprocessingData.IsType<DateTime>(columnIndex)) {
    133         stdDev = GetDateTimeAsSeconds(columnIndex, false).StandardDeviation();
     133        stdDev = GetDateTimeAsSeconds(columnIndex).StandardDeviation();
    134134      }
    135135      return stdDev;
     
    139139      double variance = double.NaN;
    140140      if (preprocessingData.IsType<double>(columnIndex)) {
    141         variance = preprocessingData.GetValues<double>(columnIndex, false).Variance();
     141        variance = preprocessingData.GetValues<double>(columnIndex).Variance();
    142142      } else if (preprocessingData.IsType<DateTime>(columnIndex)) {
    143         variance = GetDateTimeAsSeconds(columnIndex, false).Variance();
     143        variance = GetDateTimeAsSeconds(columnIndex).Variance();
    144144      }
    145145      return variance;
     
    147147
    148148    public int GetDifferentValuesCount<T>(int columnIndex) {
    149       return preprocessingData.GetValues<T>(columnIndex, false).GroupBy(x => x).Count();
     149      return preprocessingData.GetValues<T>(columnIndex).GroupBy(x => x).Count();
    150150    }
    151151
     
    179179    }
    180180
    181     private IEnumerable<double> GetDateTimeAsSeconds(int columnIndex, bool considerSelection) {
     181    private IEnumerable<double> GetDateTimeAsSeconds(int columnIndex, bool considerSelection = false) {
    182182      return GetValuesWithoutNaN<DateTime>(columnIndex, considerSelection).Select(x => (double)x.Ticks / TimeSpan.TicksPerSecond);
    183183    }
    184184
    185     private IEnumerable<T> GetValuesWithoutNaN<T>(int columnIndex, bool considerSelection) {
     185    private IEnumerable<T> GetValuesWithoutNaN<T>(int columnIndex, bool considerSelection = false) {
    186186      return searchLogic.GetValuesWithoutNaN<T>(columnIndex, considerSelection);
    187187    }
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IManipulationLogic.cs

    r10809 r10811  
    2828    void ReOrderToIndices(IList<Tuple<int, int>> indices);
    2929    void ShuffleToIndices(IList<System.Tuple<int, int>> indices);
    30     void ReplaceIndicesByAverageValue(IDictionary<int, IList<int>> cells, bool considerSelection);
     30    void ReplaceIndicesByAverageValue(IDictionary<int, IList<int>> cells, bool considerSelection = false);
    3131    void ReplaceIndicesByLinearInterpolationOfNeighbours(IDictionary<int, IList<int>> cells);
    32     void ReplaceIndicesByMedianValue(IDictionary<int, IList<int>> cells, bool considerSelection);
    33     void ReplaceIndicesByMostCommonValue(IDictionary<int, IList<int>> cells, bool considerSelection);
    34     void ReplaceIndicesByRandomValue(IDictionary<int, IList<int>> cells, bool considerSelection);
     32    void ReplaceIndicesByMedianValue(IDictionary<int, IList<int>> cells, bool considerSelection = false);
     33    void ReplaceIndicesByMostCommonValue(IDictionary<int, IList<int>> cells, bool considerSelection = false);
     34    void ReplaceIndicesByRandomValue(IDictionary<int, IList<int>> cells, bool considerSelection = false);
    3535    void ReplaceIndicesByValue(IDictionary<int, IList<int>> cells, string value);
    3636    void ReplaceIndicesByValue<T>(int columnIndex, IEnumerable<int> rowIndices, T value);
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IPreprocessingData.cs

    r10809 r10811  
    3737
    3838    [Obsolete("use the index based variant, is faster")]
    39     IList<T> GetValues<T>(string variableName, bool considerSelection);
    40     IList<T> GetValues<T>(int columnIndex, bool considerSelection);
     39    IList<T> GetValues<T>(string variableName, bool considerSelection = false);
     40    IList<T> GetValues<T>(int columnIndex, bool considerSelection = false);
    4141
    4242    void SetValues<T>(int columnIndex, IList<T> values);
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/ISearchLogic.cs

    r10809 r10811  
    3939    bool IsMissingValue(int columnIndex, int rowIndex);
    4040
    41     IEnumerable<T> GetValuesWithoutNaN<T>(int columnIndex, bool considerSelection);
     41    IEnumerable<T> GetValuesWithoutNaN<T>(int columnIndex, bool considerSelection = false);
    4242  }
    4343}
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IStatisticsLogic.cs

    r10809 r10811  
    3333    int GetRowMissingValueCount(int rowIndex);
    3434
    35     T GetMin<T>(int columnIndex, bool considerSelection) where T : IComparable<T>;
    36     T GetMax<T>(int columnIndex, bool considerSelection) where T : IComparable<T>;
     35    T GetMin<T>(int columnIndex, bool considerSelection = false) where T : IComparable<T>;
     36    T GetMax<T>(int columnIndex, bool considerSelection = false) where T : IComparable<T>;
    3737
    38     double GetMedian(int columnIndex, bool considerSelection);
    39     double GetAverage(int columnIndex, bool considerSelection);
    40     DateTime GetMedianDateTime(int columnIndex, bool considerSelection);
    41     DateTime GetAverageDateTime(int columnIndex, bool considerSelection);
     38    double GetMedian(int columnIndex, bool considerSelection = false);
     39    double GetAverage(int columnIndex, bool considerSelection = false);
     40    DateTime GetMedianDateTime(int columnIndex, bool considerSelection = false);
     41    DateTime GetAverageDateTime(int columnIndex, bool considerSelection = false);
    4242
    4343    double GetStandardDeviation(int columnIndex);
    4444    double GetVariance(int columnIndex);
    45     T GetMostCommonValue<T>(int columnIndex, bool considerSelection);
     45    T GetMostCommonValue<T>(int columnIndex, bool considerSelection = false);
    4646    int GetDifferentValuesCount<T>(int columnIndex);
    4747
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/PreprocessingTransformator.cs

    r10809 r10811  
    5454        int colIndex = preprocessingData.GetColumnIndex(transformation.Column);
    5555
    56         var originalData = preprocessingData.GetValues<double>(colIndex, false);
     56        var originalData = preprocessingData.GetValues<double>(colIndex);
    5757        var transformedData = ApplyDoubleTransformation(transformation, originalData, out success);
    5858        if (!success) return;
Note: See TracChangeset for help on using the changeset viewer.