Changeset 12169 for branches/DataPreprocessingImprovements
- Timestamp:
- 03/09/15 18:18:22 (10 years ago)
- Location:
- branches/DataPreprocessingImprovements
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessingImprovements/HeuristicLab.DataPreprocessing.Views/3.4/HistogramView.Designer.cs
r11043 r12169 25 25 private void InitializeComponent() { 26 26 this.optionsBox = new System.Windows.Forms.GroupBox(); 27 this.displayDetailsCheckBox = new System.Windows.Forms.CheckBox(); 27 28 this.label1 = new System.Windows.Forms.Label(); 28 29 this.classifierComboBox = new System.Windows.Forms.ComboBox(); … … 33 34 // 34 35 this.optionsBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 36 this.optionsBox.Controls.Add(this.displayDetailsCheckBox); 35 37 this.optionsBox.Controls.Add(this.label1); 36 38 this.optionsBox.Controls.Add(this.classifierComboBox); 37 this.optionsBox.Location = new System.Drawing.Point(4, 263); 39 this.optionsBox.Location = new System.Drawing.Point(5, 324); 40 this.optionsBox.Margin = new System.Windows.Forms.Padding(4); 38 41 this.optionsBox.Name = "optionsBox"; 39 this.optionsBox.Size = new System.Drawing.Size(152, 134); 42 this.optionsBox.Padding = new System.Windows.Forms.Padding(4); 43 this.optionsBox.Size = new System.Drawing.Size(203, 165); 40 44 this.optionsBox.TabIndex = 7; 41 45 this.optionsBox.TabStop = false; 42 46 this.optionsBox.Text = "Options"; 43 47 // 48 // displayDetailsCheckBox 49 // 50 this.displayDetailsCheckBox.AutoSize = true; 51 this.displayDetailsCheckBox.Location = new System.Drawing.Point(7, 71); 52 this.displayDetailsCheckBox.Name = "displayDetailsCheckBox"; 53 this.displayDetailsCheckBox.RightToLeft = System.Windows.Forms.RightToLeft.Yes; 54 this.displayDetailsCheckBox.Size = new System.Drawing.Size(153, 21); 55 this.displayDetailsCheckBox.TabIndex = 3; 56 this.displayDetailsCheckBox.Text = "Display value count"; 57 this.displayDetailsCheckBox.UseVisualStyleBackColor = true; 58 this.displayDetailsCheckBox.CheckedChanged += new System.EventHandler(this.displayDetailsCheckBox_CheckedChanged); 59 // 44 60 // label1 45 61 // 46 62 this.label1.AutoSize = true; 47 this.label1.Location = new System.Drawing.Point(6, 26); 63 this.label1.Location = new System.Drawing.Point(4, 19); 64 this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); 48 65 this.label1.Name = "label1"; 49 this.label1.Size = new System.Drawing.Size( 91, 13);66 this.label1.Size = new System.Drawing.Size(108, 17); 50 67 this.label1.TabIndex = 2; 51 this.label1.Text = " Classifiervariable:";68 this.label1.Text = "Target variable:"; 52 69 // 53 70 // classifierComboBox … … 55 72 this.classifierComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 56 73 this.classifierComboBox.FormattingEnabled = true; 57 this.classifierComboBox.Location = new System.Drawing.Point(9, 52); 74 this.classifierComboBox.Location = new System.Drawing.Point(7, 40); 75 this.classifierComboBox.Margin = new System.Windows.Forms.Padding(4); 58 76 this.classifierComboBox.Name = "classifierComboBox"; 59 this.classifierComboBox.Size = new System.Drawing.Size(1 21, 21);77 this.classifierComboBox.Size = new System.Drawing.Size(160, 24); 60 78 this.classifierComboBox.TabIndex = 1; 61 79 this.classifierComboBox.SelectedIndexChanged += new System.EventHandler(this.classifierComboBox_SelectedIndexChanged); … … 63 81 // HistogramView 64 82 // 65 this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 13F);83 this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); 66 84 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 67 85 this.Controls.Add(this.optionsBox); 86 this.Margin = new System.Windows.Forms.Padding(5); 68 87 this.Name = "HistogramView"; 69 88 this.Controls.SetChildIndex(this.optionsBox, 0); … … 79 98 private System.Windows.Forms.ComboBox classifierComboBox; 80 99 private System.Windows.Forms.Label label1; 100 private System.Windows.Forms.CheckBox displayDetailsCheckBox; 81 101 82 102 } -
branches/DataPreprocessingImprovements/HeuristicLab.DataPreprocessing.Views/3.4/HistogramView.cs
r12012 r12169 70 70 71 71 Content.ClassifierVariableIndex = classifierComboBox.SelectedIndex; 72 73 GenerateChart(); 72 if (Content.IsDetailedChartViewEnabled != IsDetailedChartViewEnabled) { 73 displayDetailsCheckBox.Checked = Content.IsDetailedChartViewEnabled; 74 } else { 75 GenerateChart(); 76 } 77 } 78 private void displayDetailsCheckBox_CheckedChanged(object sender, EventArgs e) { 79 bool isChecked = displayDetailsCheckBox.Checked; 80 if (IsDetailedChartViewEnabled != isChecked) { 81 IsDetailedChartViewEnabled = isChecked; 82 Content.IsDetailedChartViewEnabled = isChecked; 83 GenerateChart(); 84 } 74 85 } 75 86 } -
branches/DataPreprocessingImprovements/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingChartView.cs
r12012 r12169 49 49 50 50 public IEnumerable<double> Classification { get; set; } 51 public bool IsDetailedChartViewEnabled { get; set; } 51 52 52 53 public PreprocessingChartView() { … … 354 355 PreprocessingDataTableView dataView = new PreprocessingDataTableView(); 355 356 dataView.Classification = Classification; 357 dataView.IsDetailedChartViewEnabled = IsDetailedChartViewEnabled; 356 358 357 359 if (dataTable == null) { -
branches/DataPreprocessingImprovements/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingDataTableView.cs
r12012 r12169 47 47 48 48 public IEnumerable<double> Classification { get; set; } 49 public bool IsDetailedChartViewEnabled { get; set; } 49 50 50 51 public PreprocessingDataTableView() { … … 145 146 RegisterDataRowEvents(row); 146 147 var series = new Series(row.Name); 147 if (row.VisualProperties.DisplayName.Trim() != String.Empty) series.LegendText = row.VisualProperties.DisplayName; 148 if (row.VisualProperties.DisplayName.Trim() != String.Empty) 149 series.LegendText = row.VisualProperties.DisplayName; 148 150 else series.LegendText = row.Name; 151 149 152 ConfigureSeries(series, row); 150 153 FillSeriesWithRowValues(series, row); 151 154 155 if (IsDetailedChartViewEnabled) { 156 series.LegendText += " Values: " + row.Values.Count; 157 } 152 158 if (Classification == null) 153 159 chart.Series.Add(series); … … 661 667 662 668 chart.Titles.Add(row.Name); 663 669 int featureOverallValueCount = 0; 670 if (IsDetailedChartViewEnabled) 671 featureOverallValueCount = row.Values.Count(x => !IsInvalidValue(x)); 664 672 foreach (KeyValuePair<double, List<double>> entry in valuesPerClass) { 665 673 var s = new Series(row.Name + entry.Key); … … 669 677 670 678 s.LegendText = entry.Key.ToString(); 671 679 if (IsDetailedChartViewEnabled) { 680 int featureValueCount = entry.Value.Count(x => !IsInvalidValue(x)); 681 s.LegendText += " Values: "; 682 s.LegendText += (featureOverallValueCount > 0) ? 683 string.Format("{0} ({1:F2}%)", featureValueCount, (featureValueCount / (double)featureOverallValueCount) * 100) 684 : "0"; 685 } 672 686 chart.Series.Add(s); 673 687 } … … 752 766 ? "Y" 753 767 : Content.VisualProperties.YAxisTitle; 754 series.Points.Add(new DataPoint(d - intervalCenter, sum) { 755 ToolTip = 756 xAxisTitle + ": [" + (d - intervalWidth) + "-" + d + ")" + Environment.NewLine + 757 yAxisTitle + ": " + sum 758 }); 768 DataPoint newDataPoint = new DataPoint(d - intervalCenter, sum); 769 newDataPoint.ToolTip = 770 xAxisTitle + ": [" + (d - intervalWidth) + "-" + d + ")" + Environment.NewLine + 771 yAxisTitle + ": " + sum; 772 int overallValueCount = row.Values.Count(); 773 if (overallValueCount > 0) 774 newDataPoint.ToolTip += string.Format(" ({0:F2}%)", (sum / overallValueCount) * 100); 775 series.Points.Add(newDataPoint); 759 776 } 760 777 } -
branches/DataPreprocessingImprovements/HeuristicLab.DataPreprocessing/3.4/Implementations/HistogramContent.cs
r12012 r12169 42 42 set { this.classifierVariableIndex = value; } 43 43 } 44 public bool IsDetailedChartViewEnabled { get; set; } 44 45 45 46
Note: See TracChangeset
for help on using the changeset viewer.