Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/08/15 15:32:12 (9 years ago)
Author:
dglaser
Message:

#2388: Merged trunk into HiveStatistics branch

Location:
branches/HiveStatistics/sources
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/HiveStatistics/sources

  • branches/HiveStatistics/sources/HeuristicLab.DataPreprocessing/3.4

    • Property svn:mergeinfo set to (toggle deleted branches)
      /stable/HeuristicLab.DataPreprocessing/3.4mergedeligible
      /trunk/sources/HeuristicLab.DataPreprocessing/3.4mergedeligible
      /branches/1721-RandomForestPersistence/HeuristicLab.DataPreprocessing/3.410321-10322
      /branches/1721-RandomForestPersistence/HeuristicLab.DataPreprocessing/HeuristicLab.DataPreprocessing/3.410321-10322
      /branches/Algorithms.GradientDescent/HeuristicLab.DataPreprocessing/3.45516-5520
      /branches/Algorithms.GradientDescent/HeuristicLab.DataPreprocessing/HeuristicLab.DataPreprocessing/3.45516-5520
      /branches/Benchmarking/sources/HeuristicLab.DataPreprocessing/3.46917-7005
      /branches/Benchmarking/sources/HeuristicLab.DataPreprocessing/HeuristicLab.DataPreprocessing/3.46917-7005
      /branches/CloningRefactoring/HeuristicLab.DataPreprocessing/3.44656-4721
      /branches/CloningRefactoring/HeuristicLab.DataPreprocessing/HeuristicLab.DataPreprocessing/3.44656-4721
      /branches/CodeEditor/HeuristicLab.DataPreprocessing/3.411700-11806
      /branches/CodeEditor/HeuristicLab.DataPreprocessing/HeuristicLab.DataPreprocessing/3.411700-11806
      /branches/DataAnalysis Refactoring/HeuristicLab.DataPreprocessing/3.45471-5808
      /branches/DataAnalysis Refactoring/HeuristicLab.DataPreprocessing/HeuristicLab.DataPreprocessing/3.45471-5808
      /branches/DataAnalysis SolutionEnsembles/HeuristicLab.DataPreprocessing/3.45815-6180
      /branches/DataAnalysis SolutionEnsembles/HeuristicLab.DataPreprocessing/HeuristicLab.DataPreprocessing/3.45815-6180
      /branches/DataAnalysis/HeuristicLab.DataPreprocessing/3.44458-4459,​4462,​4464
      /branches/DataAnalysis/HeuristicLab.DataPreprocessing/HeuristicLab.DataPreprocessing/3.44458-4459,​4462,​4464
      /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.410085-11101
      /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/HeuristicLab.DataPreprocessing/3.410085-11101
      /branches/DataPreprocessingImprovements/3.412051
      /branches/DataPreprocessingImprovements/HeuristicLab.DataPreprocessing/3.412053-12675
      /branches/GP.Grammar.Editor/HeuristicLab.DataPreprocessing/3.46284-6795
      /branches/GP.Grammar.Editor/HeuristicLab.DataPreprocessing/HeuristicLab.DataPreprocessing/3.46284-6795
      /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.DataPreprocessing/3.45060
      /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.DataPreprocessing/HeuristicLab.DataPreprocessing/3.45060
      /branches/HLScript/HeuristicLab.DataPreprocessing/3.410331-10358
      /branches/HLScript/HeuristicLab.DataPreprocessing/HeuristicLab.DataPreprocessing/3.410331-10358
      /branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.DataPreprocessing/3.411570-12508
      /branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.DataPreprocessing/3.46123-9799
      /branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.DataPreprocessing/HeuristicLab.DataPreprocessing/3.46123-9799
      /branches/LogResidualEvaluator/HeuristicLab.DataPreprocessing/3.410202-10483
      /branches/LogResidualEvaluator/HeuristicLab.DataPreprocessing/HeuristicLab.DataPreprocessing/3.410202-10483
      /branches/NET40/sources/HeuristicLab.DataPreprocessing/3.45138-5162
      /branches/NET40/sources/HeuristicLab.DataPreprocessing/HeuristicLab.DataPreprocessing/3.45138-5162
      /branches/NSGA-II Changes/HeuristicLab.DataPreprocessing/3.412033-12122
      /branches/ParallelEngine/HeuristicLab.DataPreprocessing/3.45175-5192
      /branches/ParallelEngine/HeuristicLab.DataPreprocessing/HeuristicLab.DataPreprocessing/3.45175-5192
      /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.DataPreprocessing/3.47568-7810
      /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.DataPreprocessing/HeuristicLab.DataPreprocessing/3.47568-7810
      /branches/QAPAlgorithms/HeuristicLab.DataPreprocessing/3.46350-6627
      /branches/QAPAlgorithms/HeuristicLab.DataPreprocessing/HeuristicLab.DataPreprocessing/3.46350-6627
      /branches/Restructure trunk solution/HeuristicLab.DataPreprocessing/3.46828
      /branches/Restructure trunk solution/HeuristicLab.DataPreprocessing/HeuristicLab.DataPreprocessing/3.46828
      /branches/RuntimeOptimizer/HeuristicLab.DataPreprocessing/3.48943-9078
      /branches/RuntimeOptimizer/HeuristicLab.DataPreprocessing/HeuristicLab.DataPreprocessing/3.48943-9078
      /branches/ScatterSearch (trunk integration)/HeuristicLab.DataPreprocessing/3.47787-8333
      /branches/ScatterSearch (trunk integration)/HeuristicLab.DataPreprocessing/HeuristicLab.DataPreprocessing/3.47787-8333
      /branches/SlaveShutdown/HeuristicLab.DataPreprocessing/3.48944-8956
      /branches/SlaveShutdown/HeuristicLab.DataPreprocessing/HeuristicLab.DataPreprocessing/3.48944-8956
      /branches/SpectralKernelForGaussianProcesses/HeuristicLab.DataPreprocessing/3.410204-10479
      /branches/SpectralKernelForGaussianProcesses/HeuristicLab.DataPreprocessing/HeuristicLab.DataPreprocessing/3.410204-10479
      /branches/SuccessProgressAnalysis/HeuristicLab.DataPreprocessing/3.45370-5682
      /branches/SuccessProgressAnalysis/HeuristicLab.DataPreprocessing/HeuristicLab.DataPreprocessing/3.45370-5682
      /branches/Trunk/HeuristicLab.DataPreprocessing/3.46829-6865
      /branches/Trunk/HeuristicLab.DataPreprocessing/HeuristicLab.DataPreprocessing/3.46829-6865
      /branches/UnloadJobs/HeuristicLab.DataPreprocessing/3.49168-9215
      /branches/UnloadJobs/HeuristicLab.DataPreprocessing/HeuristicLab.DataPreprocessing/3.49168-9215
      /branches/VNS/HeuristicLab.DataPreprocessing/3.45594-5752
      /branches/VNS/HeuristicLab.DataPreprocessing/HeuristicLab.DataPreprocessing/3.45594-5752
      /branches/histogram/HeuristicLab.DataPreprocessing/3.45959-6341
      /branches/histogram/HeuristicLab.DataPreprocessing/HeuristicLab.DataPreprocessing/3.45959-6341
      /stable/HeuristicLab.DataPreprocessing/HeuristicLab.DataPreprocessing/3.410032-10033,​11170,​11173,​11175,​12008-12010
  • branches/HiveStatistics/sources/HeuristicLab.DataPreprocessing/3.4/Implementations/StatisticsLogic.cs

    r12012 r12689  
    3838
    3939    public int GetColumnCount() {
    40       return preprocessingData.Columns;
     40      return searchLogic.Columns;
    4141    }
    4242
    4343    public int GetRowCount() {
    44       return preprocessingData.Rows;
     44      return searchLogic.Rows;
    4545    }
    4646
     
    4848      int count = 0;
    4949
    50       for (int i = 0; i < preprocessingData.Columns; ++i) {
     50      for (int i = 0; i < searchLogic.Columns; ++i) {
    5151        if (preprocessingData.VariableHasType<double>(i)) {
    5252          ++count;
     
    5757
    5858    public int GetNominalColumnCount() {
    59       return preprocessingData.Columns - GetNumericColumnCount();
     59      return searchLogic.Columns - GetNumericColumnCount();
    6060    }
    6161
    6262    public int GetMissingValueCount() {
    6363      int count = 0;
    64       for (int i = 0; i < preprocessingData.Columns; ++i) {
     64      for (int i = 0; i < searchLogic.Columns; ++i) {
    6565        count += GetMissingValueCount(i);
    6666      }
     
    7373
    7474    public T GetMin<T>(int columnIndex, bool considerSelection) where T : IComparable<T> {
    75       return preprocessingData.GetValues<T>(columnIndex, considerSelection).Min();
     75      var min = default(T);
     76      if (preprocessingData.VariableHasType<T>(columnIndex)) {
     77        var values = GetValuesWithoutNaN<T>(columnIndex, considerSelection);
     78        if (values.Any()) {
     79          min = values.Min();
     80        }
     81      }
     82      return min;
    7683    }
    7784
    7885    public T GetMax<T>(int columnIndex, bool considerSelection) where T : IComparable<T> {
    79       return preprocessingData.GetValues<T>(columnIndex, considerSelection).Max();
     86      var max = default(T);
     87      if (preprocessingData.VariableHasType<T>(columnIndex)) {
     88        var values = GetValuesWithoutNaN<T>(columnIndex, considerSelection);
     89        if (values.Any()) {
     90          max = values.Max();
     91        }
     92      }
     93      return max;
    8094    }
    8195
     
    8397      double median = double.NaN;
    8498      if (preprocessingData.VariableHasType<double>(columnIndex)) {
    85         median = GetValuesWithoutNaN<double>(columnIndex, considerSelection).Median();
     99        var values = GetValuesWithoutNaN<double>(columnIndex, considerSelection);
     100        if (values.Any()) {
     101          median = values.Median();
     102        }
    86103      }
    87104      return median;
     
    91108      double avg = double.NaN;
    92109      if (preprocessingData.VariableHasType<double>(columnIndex)) {
    93         avg = GetValuesWithoutNaN<double>(columnIndex, considerSelection).Average();
     110        var values = GetValuesWithoutNaN<double>(columnIndex, considerSelection);
     111        if (values.Any()) {
     112          avg = values.Average();
     113        }
    94114      }
    95115      return avg;
     
    113133
    114134    public T GetMostCommonValue<T>(int columnIndex, bool considerSelection) {
    115       var t = preprocessingData.GetValues<T>(columnIndex, considerSelection);
    116       var t2 = t.GroupBy(x => x);
    117       var t3 = t2.Select(g => g.Key);
    118 
    119       return preprocessingData.GetValues<T>(columnIndex, considerSelection)
    120                               .GroupBy(x => x)
     135      var values = GetValuesWithoutNaN<T>(columnIndex, considerSelection);
     136      if (!values.Any())
     137        return default(T);
     138      return values.GroupBy(x => x)
    121139                              .OrderByDescending(g => g.Count())
    122140                              .Select(g => g.Key)
Note: See TracChangeset for help on using the changeset viewer.