Changeset 10811
- Timestamp:
- 05/07/14 13:19:42 (11 years ago)
- Location:
- branches/DataPreprocessing
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/ManipulationView.cs
r10809 r10811 91 91 break; 92 92 case 1: //Average 93 Content.ManipulationLogic.ReplaceIndicesByAverageValue(cells , false);93 Content.ManipulationLogic.ReplaceIndicesByAverageValue(cells); 94 94 break; 95 95 case 2: //Median 96 Content.ManipulationLogic.ReplaceIndicesByMedianValue(cells , false);96 Content.ManipulationLogic.ReplaceIndicesByMedianValue(cells); 97 97 break; 98 98 case 3: //Most Common 99 Content.ManipulationLogic.ReplaceIndicesByMostCommonValue(cells , false);99 Content.ManipulationLogic.ReplaceIndicesByMostCommonValue(cells); 100 100 break; 101 101 case 4: //Random 102 Content.ManipulationLogic.ReplaceIndicesByRandomValue(cells , false);102 Content.ManipulationLogic.ReplaceIndicesByRandomValue(cells); 103 103 break; 104 104 } -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/StatisticsView.cs
r10809 r10811 141 141 logic.GetColumnTypeAsString(columnIndex), 142 142 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(), 147 147 logic.GetStandardDeviation(columnIndex).ToString(), 148 148 logic.GetVariance(columnIndex).ToString(), 149 logic.GetMostCommonValue<double>(columnIndex , false).ToString(),149 logic.GetMostCommonValue<double>(columnIndex).ToString(), 150 150 logic.GetDifferentValuesCount<double>(columnIndex).ToString() 151 151 }; … … 163 163 "", //standard deviation 164 164 "", //variance 165 logic.GetMostCommonValue<string>(columnIndex , false).ToString(),165 logic.GetMostCommonValue<string>(columnIndex).ToString(), 166 166 logic.GetDifferentValuesCount<string>(columnIndex).ToString() 167 167 }; … … 173 173 logic.GetColumnTypeAsString(columnIndex), 174 174 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(), 179 179 logic.GetStandardDeviation(columnIndex).ToString(), 180 180 logic.GetVariance(columnIndex).ToString(), //variance 181 logic.GetMostCommonValue<DateTime>(columnIndex , false).ToString(),181 logic.GetMostCommonValue<DateTime>(columnIndex).ToString(), 182 182 logic.GetDifferentValuesCount<DateTime>(columnIndex).ToString() 183 183 }; -
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.