Changeset 14725 for branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingChartView.cs
- Timestamp:
- 03/07/17 16:55:03 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingChartView.cs
r14581 r14725 35 35 [View("Preprocessing Chart View")] 36 36 [Content(typeof(PreprocessingChartContent), false)] 37 public partial class PreprocessingChartView : PreprocessingCheckedVariablesView { 38 private const int MAX_DISTINCT_VALUES_FOR_GROUPING = 20; 37 public partial class PreprocessingChartView : PreprocessingCheckedVariablesView { 39 38 protected Dictionary<string, DataTable> dataTables; 40 39 protected Dictionary<string, DataTableControl> dataTableControls; … … 64 63 GenerateLayout(); 65 64 } 66 }67 68 protected static IEnumerable<string> GetVariableNamesForGrouping(IPreprocessingData preprocessingData) {69 var variableNames = new List<string>();70 71 for (int i = 0; i < preprocessingData.Columns; ++i) {72 int distinctValues = Int32.MaxValue;73 if (preprocessingData.VariableHasType<double>(i))74 distinctValues = preprocessingData.GetValues<double>(i).GroupBy(x => x).Count();75 else if (preprocessingData.VariableHasType<string>(i))76 distinctValues = preprocessingData.GetValues<string>(i).GroupBy(x => x).Count();77 else if (preprocessingData.VariableHasType<DateTime>(i))78 distinctValues = preprocessingData.GetValues<DateTime>(i).GroupBy(x => x).Count();79 80 if (distinctValues <= MAX_DISTINCT_VALUES_FOR_GROUPING)81 variableNames.Add(preprocessingData.GetVariableName(i));82 }83 return variableNames;84 65 } 85 66
Note: See TracChangeset
for help on using the changeset viewer.