Free cookie consent management tool by TermsFeed Policy Generator

Changeset 12169


Ignore:
Timestamp:
03/09/15 18:18:22 (9 years ago)
Author:
ehopf
Message:

#2335: Added an option to display the missing value count within the Histogram view.

Location:
branches/DataPreprocessingImprovements
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessingImprovements/HeuristicLab.DataPreprocessing.Views/3.4/HistogramView.Designer.cs

    r11043 r12169  
    2525    private void InitializeComponent() {
    2626      this.optionsBox = new System.Windows.Forms.GroupBox();
     27      this.displayDetailsCheckBox = new System.Windows.Forms.CheckBox();
    2728      this.label1 = new System.Windows.Forms.Label();
    2829      this.classifierComboBox = new System.Windows.Forms.ComboBox();
     
    3334      //
    3435      this.optionsBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     36      this.optionsBox.Controls.Add(this.displayDetailsCheckBox);
    3537      this.optionsBox.Controls.Add(this.label1);
    3638      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);
    3841      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);
    4044      this.optionsBox.TabIndex = 7;
    4145      this.optionsBox.TabStop = false;
    4246      this.optionsBox.Text = "Options";
    4347      //
     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      //
    4460      // label1
    4561      //
    4662      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);
    4865      this.label1.Name = "label1";
    49       this.label1.Size = new System.Drawing.Size(91, 13);
     66      this.label1.Size = new System.Drawing.Size(108, 17);
    5067      this.label1.TabIndex = 2;
    51       this.label1.Text = "Classifier variable:";
     68      this.label1.Text = "Target variable:";
    5269      //
    5370      // classifierComboBox
     
    5572      this.classifierComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
    5673      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);
    5876      this.classifierComboBox.Name = "classifierComboBox";
    59       this.classifierComboBox.Size = new System.Drawing.Size(121, 21);
     77      this.classifierComboBox.Size = new System.Drawing.Size(160, 24);
    6078      this.classifierComboBox.TabIndex = 1;
    6179      this.classifierComboBox.SelectedIndexChanged += new System.EventHandler(this.classifierComboBox_SelectedIndexChanged);
     
    6381      // HistogramView
    6482      //
    65       this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     83      this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
    6684      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    6785      this.Controls.Add(this.optionsBox);
     86      this.Margin = new System.Windows.Forms.Padding(5);
    6887      this.Name = "HistogramView";
    6988      this.Controls.SetChildIndex(this.optionsBox, 0);
     
    7998    private System.Windows.Forms.ComboBox classifierComboBox;
    8099    private System.Windows.Forms.Label label1;
     100    private System.Windows.Forms.CheckBox displayDetailsCheckBox;
    81101
    82102  }
  • branches/DataPreprocessingImprovements/HeuristicLab.DataPreprocessing.Views/3.4/HistogramView.cs

    r12012 r12169  
    7070
    7171      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      }
    7485    }
    7586  }
  • branches/DataPreprocessingImprovements/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingChartView.cs

    r12012 r12169  
    4949
    5050    public IEnumerable<double> Classification { get; set; }
     51    public bool IsDetailedChartViewEnabled { get; set; }
    5152
    5253    public PreprocessingChartView() {
     
    354355      PreprocessingDataTableView dataView = new PreprocessingDataTableView();
    355356      dataView.Classification = Classification;
     357      dataView.IsDetailedChartViewEnabled = IsDetailedChartViewEnabled;
    356358
    357359      if (dataTable == null) {
  • branches/DataPreprocessingImprovements/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingDataTableView.cs

    r12012 r12169  
    4747
    4848    public IEnumerable<double> Classification { get; set; }
     49    public bool IsDetailedChartViewEnabled { get; set; }
    4950
    5051    public PreprocessingDataTableView() {
     
    145146        RegisterDataRowEvents(row);
    146147        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;
    148150        else series.LegendText = row.Name;
     151
    149152        ConfigureSeries(series, row);
    150153        FillSeriesWithRowValues(series, row);
    151154
     155        if (IsDetailedChartViewEnabled) {
     156          series.LegendText += " Values: " + row.Values.Count;
     157        }
    152158        if (Classification == null)
    153159          chart.Series.Add(series);
     
    661667
    662668        chart.Titles.Add(row.Name);
    663 
     669        int featureOverallValueCount = 0;
     670        if (IsDetailedChartViewEnabled)
     671          featureOverallValueCount = row.Values.Count(x => !IsInvalidValue(x));
    664672        foreach (KeyValuePair<double, List<double>> entry in valuesPerClass) {
    665673          var s = new Series(row.Name + entry.Key);
     
    669677
    670678          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          }
    672686          chart.Series.Add(s);
    673687        }
     
    752766                              ? "Y"
    753767                              : 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);
    759776      }
    760777    }
  • branches/DataPreprocessingImprovements/HeuristicLab.DataPreprocessing/3.4/Implementations/HistogramContent.cs

    r12012 r12169  
    4242      set { this.classifierVariableIndex = value; }
    4343    }
     44    public bool IsDetailedChartViewEnabled { get; set; }
    4445
    4546
Note: See TracChangeset for help on using the changeset viewer.