Changeset 14994
- Timestamp:
- 05/17/17 14:37:40 (8 years ago)
- Location:
- branches/DataPreprocessing Enhancements
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingFeatureCorrelationView.Designer.cs
r14185 r14994 22 22 #endregion 23 23 24 namespace HeuristicLab. Problems.DataAnalysis.Views {24 namespace HeuristicLab.DataPreprocessing.Views { 25 25 partial class PreprocessingFeatureCorrelationView { 26 26 /// <summary> … … 48 48 private void InitializeComponent() { 49 49 this.components = new System.ComponentModel.Container(); 50 this.checkInputsTargetButton = new System.Windows.Forms.Button(); 51 this.uncheckAllButton = new System.Windows.Forms.Button(); 52 this.checkAllButton = new System.Windows.Forms.Button(); 53 this.correlationView = new HeuristicLab.Problems.DataAnalysis.Views.FeatureCorrelationView(); 54 this.variablesLabel = new System.Windows.Forms.Label(); 55 this.toolTip = new System.Windows.Forms.ToolTip(this.components); 56 this.SuspendLayout(); 57 // 58 // checkInputsTargetButton 59 // 60 this.checkInputsTargetButton.Image = global::HeuristicLab.DataPreprocessing.Views.PreprocessingIcons.Inputs; 61 this.checkInputsTargetButton.Location = new System.Drawing.Point(736, 5); 62 this.checkInputsTargetButton.Name = "checkInputsTargetButton"; 63 this.checkInputsTargetButton.Size = new System.Drawing.Size(24, 24); 64 this.checkInputsTargetButton.TabIndex = 14; 65 this.toolTip.SetToolTip(this.checkInputsTargetButton, "Inputs & Target Variables"); 66 this.checkInputsTargetButton.UseVisualStyleBackColor = true; 67 this.checkInputsTargetButton.Click += new System.EventHandler(this.checkInputsTargetButton_Click); 68 // 69 // uncheckAllButton 70 // 71 this.uncheckAllButton.Image = global::HeuristicLab.DataPreprocessing.Views.PreprocessingIcons.None; 72 this.uncheckAllButton.Location = new System.Drawing.Point(766, 5); 73 this.uncheckAllButton.Name = "uncheckAllButton"; 74 this.uncheckAllButton.Size = new System.Drawing.Size(24, 24); 75 this.uncheckAllButton.TabIndex = 12; 76 this.toolTip.SetToolTip(this.uncheckAllButton, "None"); 77 this.uncheckAllButton.UseVisualStyleBackColor = true; 78 this.uncheckAllButton.Click += new System.EventHandler(this.uncheckAllButton_Click); 79 // 80 // checkAllButton 81 // 82 this.checkAllButton.Image = global::HeuristicLab.DataPreprocessing.Views.PreprocessingIcons.All; 83 this.checkAllButton.Location = new System.Drawing.Point(706, 5); 84 this.checkAllButton.Name = "checkAllButton"; 85 this.checkAllButton.Size = new System.Drawing.Size(24, 24); 86 this.checkAllButton.TabIndex = 13; 87 this.toolTip.SetToolTip(this.checkAllButton, "All"); 88 this.checkAllButton.UseVisualStyleBackColor = true; 89 this.checkAllButton.Click += new System.EventHandler(this.checkAllButton_Click); 90 // 91 // correlationView 92 // 93 this.correlationView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 94 | System.Windows.Forms.AnchorStyles.Left) 95 | System.Windows.Forms.AnchorStyles.Right))); 96 this.correlationView.Caption = "Feature Correlation View"; 97 this.correlationView.Content = null; 98 this.correlationView.Location = new System.Drawing.Point(0, 0); 99 this.correlationView.Name = "correlationView"; 100 this.correlationView.ReadOnly = false; 101 this.correlationView.Size = new System.Drawing.Size(1013, 640); 102 this.correlationView.TabIndex = 18; 103 // 104 // variablesLabel 105 // 106 this.variablesLabel.AutoSize = true; 107 this.variablesLabel.Location = new System.Drawing.Point(650, 11); 108 this.variablesLabel.Name = "variablesLabel"; 109 this.variablesLabel.Size = new System.Drawing.Size(50, 13); 110 this.variablesLabel.TabIndex = 15; 111 this.variablesLabel.Text = "Variables"; 112 // 113 // PreprocessingFeatureCorrelationView 114 // 115 this.Controls.Add(this.variablesLabel); 116 this.Controls.Add(this.checkInputsTargetButton); 117 this.Controls.Add(this.uncheckAllButton); 118 this.Controls.Add(this.checkAllButton); 119 this.Controls.Add(this.correlationView); 120 this.Name = "PreprocessingFeatureCorrelationView"; 121 this.Size = new System.Drawing.Size(1013, 640); 50 122 this.ResumeLayout(false); 123 this.PerformLayout(); 124 51 125 } 52 126 53 127 #endregion 128 private System.Windows.Forms.Button checkInputsTargetButton; 129 private System.Windows.Forms.Button uncheckAllButton; 130 private System.Windows.Forms.Button checkAllButton; 131 private HeuristicLab.Problems.DataAnalysis.Views.FeatureCorrelationView correlationView; 132 private System.Windows.Forms.ToolTip toolTip; 133 private System.Windows.Forms.Label variablesLabel; 54 134 } 55 135 } -
branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingFeatureCorrelationView.cs
r14470 r14994 20 20 #endregion 21 21 22 using System.Windows.Forms; 23 using HeuristicLab.DataPreprocessing; 22 using System; 23 using System.Linq; 24 using HeuristicLab.Data.Views; 24 25 using HeuristicLab.MainForm; 25 26 using HeuristicLab.MainForm.WindowsForms; 26 27 27 namespace HeuristicLab. Problems.DataAnalysis.Views {28 namespace HeuristicLab.DataPreprocessing.Views { 28 29 [View("Preprocessing Feature Correlation View")] 29 30 [Content(typeof(CorrelationMatrixContent), true)] … … 35 36 } 36 37 37 FeatureCorrelationView correlationView;38 39 38 public PreprocessingFeatureCorrelationView() { 40 39 InitializeComponent(); 41 correlationView = new FeatureCorrelationView();42 correlationView.Dock = DockStyle.Fill;43 this.Controls.Add(correlationView);44 40 } 45 46 41 47 42 protected override void RegisterContentEvents() { … … 61 56 protected override void OnContentChanged() { 62 57 base.OnContentChanged(); 63 if (Content == null) { 64 correlationView.Content = null; 58 correlationView.Content = Content != null ? Content.ProblemData : null; 59 } 60 61 #region Check Variables 62 private void checkAllButton_Click(object sender, System.EventArgs e) { 63 SetVisibility(x => true); 64 } 65 private void checkInputsTargetButton_Click(object sender, System.EventArgs e) { 66 var ppd = Content.PreprocessingData; 67 SetVisibility(x => ppd.InputVariables.Contains(x) || ppd.TargetVariable == x); 68 } 69 private void uncheckAllButton_Click(object sender, System.EventArgs e) { 70 SetVisibility(x => false); 71 } 72 private void SetVisibility(Func<string, bool> check) { 73 var dataView = (EnhancedStringConvertibleMatrixView)correlationView.Controls.Find("DataView", searchAllChildren: true).Single(); 74 var ppd = Content.PreprocessingData; 75 var visibilities = ppd.VariableNames.Where((v, i) => ppd.VariableHasType<double>(i)).Select(check).ToList(); 76 if (dataView.Content.Rows != dataView.Content.Columns || dataView.Content.Rows != visibilities.Count) 65 77 return; 66 }67 78 68 correlationView.Content = Content.ProblemData; 79 dataView.ColumnVisibility = visibilities; 80 dataView.RowVisibility = visibilities; 81 dataView.UpdateColumnHeaders(); 82 dataView.UpdateRowHeaders(); 69 83 } 84 #endregion 70 85 } 71 86 } -
branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing/3.4/Content/CorrelationMatrixContent.cs
r14467 r14994 33 33 34 34 private PreprocessingContext Context { get; set; } 35 p rivateITransactionalPreprocessingData PreprocessingData {35 public ITransactionalPreprocessingData PreprocessingData { 36 36 get { return Context.Data; } 37 37 }
Note: See TracChangeset
for help on using the changeset viewer.