- Timestamp:
- 07/18/17 14:19:29 (7 years ago)
- Location:
- branches/DataPreprocessing Cleanup/HeuristicLab.DataPreprocessing.Views/3.4
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing Cleanup/HeuristicLab.DataPreprocessing.Views/3.4/DataCompletenessView.cs
r15110 r15269 52 52 53 53 private void InitData() { 54 IDictionary<int, IList<int>> missingValueIndices = Content.SearchLogic.GetMissingValueIndices(); 55 56 bool[,] valueMissing = new bool[Content.SearchLogic.Rows, Content.SearchLogic.Columns]; 57 foreach (var columnMissingValues in missingValueIndices) { 58 var column = columnMissingValues.Key; 59 foreach (var missingValueIndex in columnMissingValues.Value) 60 valueMissing[missingValueIndex, column] = true; 54 bool[,] valueMissing = new bool[Content.PreprocessingData.Rows, Content.PreprocessingData.Columns]; 55 for (int row = 0; row < Content.PreprocessingData.Rows; row++) { 56 for (int column = 0; column < Content.PreprocessingData.Columns; column++) 57 valueMissing[row, column] = Content.PreprocessingData.IsCellEmpty(column, row); 61 58 } 62 59 … … 78 75 //custom x axis label 79 76 double from = 0.5; 80 foreach (String columnName in Content. SearchLogic.VariableNames) {77 foreach (String columnName in Content.PreprocessingData.VariableNames) { 81 78 double to = from + 1; 82 79 chart.ChartAreas[0].AxisX.CustomLabels.Add(from, to, columnName); -
branches/DataPreprocessing Cleanup/HeuristicLab.DataPreprocessing.Views/3.4/DataPreprocessingView.cs
r15185 r15269 50 50 var data = Content.Data; 51 51 var filterLogic = new FilterLogic(data); 52 var searchLogic = new SearchLogic(data, filterLogic); 53 var statisticsLogic = new StatisticsLogic(data, searchLogic); 54 var manipulationLogic = new ManipulationLogic(data, searchLogic, statisticsLogic); 52 var statisticsLogic = new StatisticsLogic(data); 53 var manipulationLogic = new ManipulationLogic(data, statisticsLogic); 55 54 56 55 var viewShortcuts = new ItemList<IViewShortcut> { … … 63 62 new MultiScatterPlotContent(data), 64 63 new CorrelationMatrixContent(Content), 65 new DataCompletenessChartContent( searchLogic),64 new DataCompletenessChartContent(data), 66 65 67 66 new FilterContent(filterLogic), 68 new ManipulationContent(manipulationLogic, searchLogic,filterLogic),67 new ManipulationContent(manipulationLogic, filterLogic), 69 68 new TransformationContent(data, filterLogic) 70 69 }; -
branches/DataPreprocessing Cleanup/HeuristicLab.DataPreprocessing.Views/3.4/ManipulationView.cs
r15110 r15269 127 127 128 128 private void ReplaceMissingValues() { 129 var allIndices = Content.SearchLogic.GetMissingValueIndices();129 var missingValuesIndices = new List<int>(); 130 130 var columnIndex = cmbVariableNames.SelectedIndex; 131 var columnIndices = new Dictionary<int, IList<int>>{ 132 {columnIndex, allIndices[columnIndex]} 133 }; 131 var columnIndices = new Dictionary<int, IList<int>> { { columnIndex, missingValuesIndices } }; 132 133 for (int rowIndex = 0; rowIndex < Content.ManipulationLogic.PreProcessingData.Rows; rowIndex++) 134 if (Content.ManipulationLogic.PreProcessingData.IsCellEmpty(columnIndex, rowIndex)) 135 missingValuesIndices.Add(rowIndex); 134 136 135 137 switch (cmbReplaceWith.SelectedIndex) { … … 165 167 sb.Append(Environment.NewLine); 166 168 sb.Append("Columns: "); 167 sb.Append(Content. SearchLogic.VariableNames.ElementAt(filteredColumns.ElementAt(0)));169 sb.Append(Content.ManipulationLogic.VariableNames.ElementAt(filteredColumns.ElementAt(0))); 168 170 for (int i = 1; i < filteredColumns.Count; i++) { 169 string columnName = Content. SearchLogic.VariableNames.ElementAt(filteredColumns.ElementAt(i));171 string columnName = Content.ManipulationLogic.VariableNames.ElementAt(filteredColumns.ElementAt(i)); 170 172 sb.Append(", "); 171 173 sb.Append(columnName); … … 196 198 sb.Append(Environment.NewLine); 197 199 sb.Append("Columns: "); 198 sb.Append(Content. SearchLogic.VariableNames.ElementAt(filteredColumns.ElementAt(0)));200 sb.Append(Content.ManipulationLogic.VariableNames.ElementAt(filteredColumns.ElementAt(0))); 199 201 for (int i = 1; i < filteredColumns.Count; i++) { 200 string columnName = Content. SearchLogic.VariableNames.ElementAt(filteredColumns.ElementAt(i));202 string columnName = Content.ManipulationLogic.VariableNames.ElementAt(filteredColumns.ElementAt(i)); 201 203 sb.Append(", "); 202 204 sb.Append(columnName); … … 250 252 } 251 253 if (btnApply.Enabled) { 252 var allIndices = Content.SearchLogic.GetMissingValueIndices(); 253 int count = allIndices[columnIndex].Count; 254 int count = 0; 255 for (int rowIndex = 0; rowIndex < Content.ManipulationLogic.PreProcessingData.Rows; rowIndex++) 256 if (Content.ManipulationLogic.PreProcessingData.IsCellEmpty(columnIndex, rowIndex)) count++; 257 254 258 int cellCount = Content.FilterLogic.PreprocessingData.Rows * Content.FilterLogic.PreprocessingData.Columns; 255 259 lblPreviewReplaceMissingValues.Text = count + " cell" + (count > 1 || count == 0 ? "s" : "") -
branches/DataPreprocessing Cleanup/HeuristicLab.DataPreprocessing.Views/3.4/ViewShortcutListView.cs
r15110 r15269 42 42 //Clone chart items 43 43 protected override void itemsListView_DoubleClick(object sender, EventArgs e) { 44 if (itemsListView.SelectedItems.Count == 1) { 45 IViewShortcut item = itemsListView.SelectedItems[0].Tag as IViewShortcut; 46 if (item != null) { 47 try { 48 item = (IViewShortcut)item.Clone(); 49 var view = MainFormManager.MainForm.ShowContent(item); 50 if (view != null) { 51 view.ReadOnly = ReadOnly; 52 view.Locked = Locked; 53 } 54 } catch (NullReferenceException) { 55 // cloning for preprocessing not done properly yet 56 } 44 if (itemsListView.SelectedItems.Count != 1) return; 45 IViewShortcut item = itemsListView.SelectedItems[0].Tag as IViewShortcut; 46 if (item == null) return; 47 try { 48 item = (IViewShortcut)item.Clone(); 49 var view = MainFormManager.MainForm.ShowContent(item); 50 if (view != null) { 51 view.ReadOnly = ReadOnly; 52 view.Locked = Locked; 57 53 } 54 } catch (NullReferenceException) { 55 // cloning for preprocessing not done properly yet 58 56 } 59 57 }
Note: See TracChangeset
for help on using the changeset viewer.