Free cookie consent management tool by TermsFeed Policy Generator

Changeset 10811 for branches


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

Legend:

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

    r10809 r10811  
    9191          break;
    9292        case 1: //Average
    93           Content.ManipulationLogic.ReplaceIndicesByAverageValue(cells, false);
     93          Content.ManipulationLogic.ReplaceIndicesByAverageValue(cells);
    9494          break;
    9595        case 2: //Median
    96           Content.ManipulationLogic.ReplaceIndicesByMedianValue(cells, false);
     96          Content.ManipulationLogic.ReplaceIndicesByMedianValue(cells);
    9797          break;
    9898        case 3: //Most Common
    99           Content.ManipulationLogic.ReplaceIndicesByMostCommonValue(cells, false);
     99          Content.ManipulationLogic.ReplaceIndicesByMostCommonValue(cells);
    100100          break;
    101101        case 4: //Random
    102           Content.ManipulationLogic.ReplaceIndicesByRandomValue(cells, false);
     102          Content.ManipulationLogic.ReplaceIndicesByRandomValue(cells);
    103103          break;
    104104      }
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/StatisticsView.cs

    r10809 r10811  
    141141        logic.GetColumnTypeAsString(columnIndex),
    142142        logic.GetMissingValueCount(columnIndex).ToString(),
    143         logic.GetMin<double>(columnIndex, false).ToString(),
    144         logic.GetMax<double>(columnIndex, false).ToString(),
    145         logic.GetMedian(columnIndex, false).ToString(),
    146         logic.GetAverage(columnIndex, false).ToString(),
     143        logic.GetMin<double>(columnIndex).ToString(),
     144        logic.GetMax<double>(columnIndex).ToString(),
     145        logic.GetMedian(columnIndex).ToString(),
     146        logic.GetAverage(columnIndex).ToString(),
    147147        logic.GetStandardDeviation(columnIndex).ToString(),
    148148        logic.GetVariance(columnIndex).ToString(),
    149         logic.GetMostCommonValue<double>(columnIndex, false).ToString(),
     149        logic.GetMostCommonValue<double>(columnIndex).ToString(),
    150150        logic.GetDifferentValuesCount<double>(columnIndex).ToString()
    151151      };
     
    163163        "", //standard deviation
    164164        "", //variance
    165         logic.GetMostCommonValue<string>(columnIndex, false).ToString(),
     165        logic.GetMostCommonValue<string>(columnIndex).ToString(),
    166166        logic.GetDifferentValuesCount<string>(columnIndex).ToString()
    167167      };
     
    173173        logic.GetColumnTypeAsString(columnIndex),
    174174        logic.GetMissingValueCount(columnIndex).ToString(),
    175         logic.GetMin<DateTime>(columnIndex, false).ToString(),
    176         logic.GetMax<DateTime>(columnIndex, false).ToString(),
    177         logic.GetMedianDateTime(columnIndex, false).ToString(),
    178         logic.GetAverageDateTime(columnIndex, false).ToString(),
     175        logic.GetMin<DateTime>(columnIndex).ToString(),
     176        logic.GetMax<DateTime>(columnIndex).ToString(),
     177        logic.GetMedianDateTime(columnIndex).ToString(),
     178        logic.GetAverageDateTime(columnIndex).ToString(),
    179179        logic.GetStandardDeviation(columnIndex).ToString(),
    180180        logic.GetVariance(columnIndex).ToString(), //variance
    181         logic.GetMostCommonValue<DateTime>(columnIndex, false).ToString(),
     181        logic.GetMostCommonValue<DateTime>(columnIndex).ToString(),
    182182        logic.GetDifferentValuesCount<DateTime>(columnIndex).ToString()
    183183      };
  • 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.