Changeset 10811 for branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/StatisticsLogic.cs
- Timestamp:
- 05/07/14 13:19:42 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/StatisticsLogic.cs
r10809 r10811 129 129 double stdDev = double.NaN; 130 130 if (preprocessingData.IsType<double>(columnIndex)) { 131 stdDev = GetValuesWithoutNaN<double>(columnIndex , false).StandardDeviation();131 stdDev = GetValuesWithoutNaN<double>(columnIndex).StandardDeviation(); 132 132 } else if (preprocessingData.IsType<DateTime>(columnIndex)) { 133 stdDev = GetDateTimeAsSeconds(columnIndex , false).StandardDeviation();133 stdDev = GetDateTimeAsSeconds(columnIndex).StandardDeviation(); 134 134 } 135 135 return stdDev; … … 139 139 double variance = double.NaN; 140 140 if (preprocessingData.IsType<double>(columnIndex)) { 141 variance = preprocessingData.GetValues<double>(columnIndex , false).Variance();141 variance = preprocessingData.GetValues<double>(columnIndex).Variance(); 142 142 } else if (preprocessingData.IsType<DateTime>(columnIndex)) { 143 variance = GetDateTimeAsSeconds(columnIndex , false).Variance();143 variance = GetDateTimeAsSeconds(columnIndex).Variance(); 144 144 } 145 145 return variance; … … 147 147 148 148 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(); 150 150 } 151 151 … … 179 179 } 180 180 181 private IEnumerable<double> GetDateTimeAsSeconds(int columnIndex, bool considerSelection ) {181 private IEnumerable<double> GetDateTimeAsSeconds(int columnIndex, bool considerSelection = false) { 182 182 return GetValuesWithoutNaN<DateTime>(columnIndex, considerSelection).Select(x => (double)x.Ticks / TimeSpan.TicksPerSecond); 183 183 } 184 184 185 private IEnumerable<T> GetValuesWithoutNaN<T>(int columnIndex, bool considerSelection ) {185 private IEnumerable<T> GetValuesWithoutNaN<T>(int columnIndex, bool considerSelection = false) { 186 186 return searchLogic.GetValuesWithoutNaN<T>(columnIndex, considerSelection); 187 187 }
Note: See TracChangeset
for help on using the changeset viewer.