Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/23/15 17:20:23 (9 years ago)
Author:
ehopf
Message:

#2335: Corrected the preview column count in the Manipulation-View (Defect 5) and added some additional information.

File:
1 edited

Legend:

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

    r12012 r12502  
    2323using System.Collections.Generic;
    2424using System.Drawing;
     25using System.Linq;
     26using System.Text;
    2527using System.Windows.Forms;
    2628using HeuristicLab.Core.Views;
     
    148150    private void validateDeleteColumnsInfo() {
    149151      validateDoubleTextBox(txtDeleteColumnsInfo.Text);
    150       if (btnApply.Enabled) {
    151         int count = Content.ManipulationLogic.ColumnsWithMissingValuesGreater(getDeleteColumnsInfo()).Count;
    152         int rowCount = Content.FilterLogic.PreprocessingData.Rows;
    153         lblPreviewColumnsInfo.Text = count + " column" + (count > 1 || count == 0 ? "s" : "") + " of " + rowCount + " (" + string.Format("{0:F2}%", 100d / rowCount * count) + ") were detected with more than " + txtDeleteColumnsInfo.Text + "% missing values.";
     152      if (btnApply.Enabled)
     153      {
     154        var filteredColumns = Content.ManipulationLogic.ColumnsWithMissingValuesGreater(getDeleteColumnsInfo());
     155        int count = filteredColumns.Count;
     156        int columnCount = Content.FilterLogic.PreprocessingData.Columns;
     157        lblPreviewColumnsInfo.Text = count + " column" + (count > 1 || count == 0 ? "s" : "") + " of " + columnCount + " (" + string.Format("{0:F2}%", 100d / columnCount * count) + ") were detected with more than " + txtDeleteColumnsInfo.Text + "% missing values.";
    154158        if (count > 0) {
    155           lblPreviewColumnsInfo.Text += Environment.NewLine + Environment.NewLine + "Please press the button \"Apply Manipulation\" if you wish to delete those columns.";
     159          StringBuilder sb = new StringBuilder();
     160          sb.Append(Environment.NewLine);
     161          sb.Append("Columns: ");
     162          sb.Append(Content.SearchLogic.VariableNames.ElementAt(filteredColumns.ElementAt(0)));
     163          for (int i = 1; i < filteredColumns.Count; i++) {
     164            string columnName = Content.SearchLogic.VariableNames.ElementAt(filteredColumns.ElementAt(i));
     165            sb.Append(", ");
     166            sb.Append(columnName);
     167          }
     168          sb.Append(Environment.NewLine);
     169          sb.Append("Please press the button \"Apply Manipulation\" if you wish to delete those columns.");
     170
     171          lblPreviewColumnsInfo.Text += sb.ToString();
    156172        } else {
    157173          btnApply.Enabled = false;
     
    165181      validateDoubleTextBox(txtDeleteColumnsVariance.Text);
    166182      if (btnApply.Enabled) {
    167         int count = Content.ManipulationLogic.ColumnsWithVarianceSmaller(getDeleteColumnsVariance()).Count;
    168         int rowCount = Content.FilterLogic.PreprocessingData.Rows;
    169         lblPreviewColumnsVariance.Text = count + " column" + (count > 1 || count == 0 ? "s" : "") + " of " + rowCount + " (" + string.Format("{0:F2}%", 100d / rowCount * count) + ") were detected with a variance smaller than " + txtDeleteColumnsVariance.Text + ".";
     183        var filteredColumns = Content.ManipulationLogic.ColumnsWithVarianceSmaller(getDeleteColumnsVariance());
     184        int count = filteredColumns.Count;
     185        int columnCount = Content.FilterLogic.PreprocessingData.Columns;
     186        lblPreviewColumnsVariance.Text = count + " column" + (count > 1 || count == 0 ? "s" : "") + " of " + columnCount + " (" + string.Format("{0:F2}%", 100d / columnCount * count) + ") were detected with a variance smaller than " + txtDeleteColumnsVariance.Text + ".";
    170187        if (count > 0) {
    171           lblPreviewColumnsVariance.Text += Environment.NewLine + Environment.NewLine + "Please press the button \"Apply Manipulation\" if you wish to delete those columns.";
     188          StringBuilder sb = new StringBuilder();
     189          sb.Append(Environment.NewLine);
     190          sb.Append("Columns: ");
     191          sb.Append(Content.SearchLogic.VariableNames.ElementAt(filteredColumns.ElementAt(0)));
     192          for (int i = 1; i < filteredColumns.Count; i++) {
     193            string columnName = Content.SearchLogic.VariableNames.ElementAt(filteredColumns.ElementAt(i));
     194            sb.Append(", ");
     195            sb.Append(columnName);
     196          }
     197          sb.Append(Environment.NewLine);
     198          sb.Append("Please press the button \"Apply Manipulation\" if you wish to delete those columns.");
     199
     200          lblPreviewColumnsVariance.Text += sb.ToString();
    172201        } else {
    173202          btnApply.Enabled = false;
Note: See TracChangeset for help on using the changeset viewer.