- Timestamp:
- 05/07/14 13:19:42 (11 years ago)
- 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 37 37 38 38 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); 40 40 DataRow row = new DataRow(variableName, "", values); 41 41 row.VisualProperties.ChartType = chartType; … … 44 44 45 45 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); 47 47 IList<double> valuesRange = new List<double>(); 48 48 for (int i = 0; i < values.Count; i++) { -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/ManipulationLogic.cs
r10809 r10811 104 104 int countValues = 0; 105 105 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(); 109 109 } 110 110 … … 256 256 private void reOrderToIndices<T>(int columnIndex, IList<Tuple<int, int>> indices) { 257 257 258 List<T> originalData = new List<T>(preprocessingData.GetValues<T>(columnIndex , false));258 List<T> originalData = new List<T>(preprocessingData.GetValues<T>(columnIndex)); 259 259 260 260 // process all columns equally -
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 } -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IManipulationLogic.cs
r10809 r10811 28 28 void ReOrderToIndices(IList<Tuple<int, int>> indices); 29 29 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); 31 31 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); 35 35 void ReplaceIndicesByValue(IDictionary<int, IList<int>> cells, string value); 36 36 void ReplaceIndicesByValue<T>(int columnIndex, IEnumerable<int> rowIndices, T value); -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IPreprocessingData.cs
r10809 r10811 37 37 38 38 [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); 41 41 42 42 void SetValues<T>(int columnIndex, IList<T> values); -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/ISearchLogic.cs
r10809 r10811 39 39 bool IsMissingValue(int columnIndex, int rowIndex); 40 40 41 IEnumerable<T> GetValuesWithoutNaN<T>(int columnIndex, bool considerSelection );41 IEnumerable<T> GetValuesWithoutNaN<T>(int columnIndex, bool considerSelection = false); 42 42 } 43 43 } -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IStatisticsLogic.cs
r10809 r10811 33 33 int GetRowMissingValueCount(int rowIndex); 34 34 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>; 37 37 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); 42 42 43 43 double GetStandardDeviation(int columnIndex); 44 44 double GetVariance(int columnIndex); 45 T GetMostCommonValue<T>(int columnIndex, bool considerSelection );45 T GetMostCommonValue<T>(int columnIndex, bool considerSelection = false); 46 46 int GetDifferentValuesCount<T>(int columnIndex); 47 47 -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/PreprocessingTransformator.cs
r10809 r10811 54 54 int colIndex = preprocessingData.GetColumnIndex(transformation.Column); 55 55 56 var originalData = preprocessingData.GetValues<double>(colIndex , false);56 var originalData = preprocessingData.GetValues<double>(colIndex); 57 57 var transformedData = ApplyDoubleTransformation(transformation, originalData, out success); 58 58 if (!success) return;
Note: See TracChangeset
for help on using the changeset viewer.