Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/11/13 21:41:08 (11 years ago)
Author:
sforsten
Message:

#2070:

  • changed parse methods in TableFileParser to accept a bool which defines, if the first line contains variable names
  • added methods in TableFileParser to check if the first line contains variable names
  • adapted unit tests
  • adapted DataAnalysisImportTypeDialog so that a checkbox can be set to define if the first line contains variable names
  • added the flag NumberStyles.AllowTrailingSign for parsing doubles
Location:
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/ClassificationImportTypeDialog.Designer.cs

    r9456 r9608  
    6262      // OkButton
    6363      //
    64       this.OkButton.Location = new System.Drawing.Point(303, 464);
     64      this.OkButton.Location = new System.Drawing.Point(303, 482);
    6565      //
    6666      // TrainingTestTrackBar
     
    7878      // CancelationButton
    7979      //
    80       this.CancelationButton.Location = new System.Drawing.Point(384, 464);
     80      this.CancelationButton.Location = new System.Drawing.Point(384, 482);
    8181      //
    8282      // ProblemDataSettingsGroupBox
     
    8787      this.ProblemDataSettingsGroupBox.Controls.Add(this.TargetVariableComboBox);
    8888      this.ProblemDataSettingsGroupBox.Controls.Add(this.UniformDistributionOfClassesCheckbox);
    89       this.ProblemDataSettingsGroupBox.Size = new System.Drawing.Size(447, 315);
     89      this.ProblemDataSettingsGroupBox.Size = new System.Drawing.Size(447, 312);
    9090      this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.UniformDistributionOfClassesCheckbox, 0);
    9191      this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.TargetVariableComboBox, 0);
     
    110110      //
    111111      this.PreviewDatasetMatrix.Location = new System.Drawing.Point(6, 134);
    112       this.PreviewDatasetMatrix.Size = new System.Drawing.Size(435, 175);
     112      this.PreviewDatasetMatrix.Size = new System.Drawing.Size(435, 172);
    113113      //
    114114      // PreviewLabel
     
    118118      // TargetVariableComboBox
    119119      //
    120       this.TargetVariableComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     120      this.TargetVariableComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
    121121            | System.Windows.Forms.AnchorStyles.Right)));
    122122      this.TargetVariableComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     
    178178      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    179179      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    180       this.ClientSize = new System.Drawing.Size(471, 499);
     180      this.ClientSize = new System.Drawing.Size(471, 517);
    181181      this.Name = "ClassificationImportTypeDialog";
    182182      this.Text = "Classification CSV Import";
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/DataAnalysisImportTypeDialog.Designer.cs

    r9456 r9608  
    7272      this.PreviewDatasetMatrix = new HeuristicLab.Data.Views.StringConvertibleMatrixView();
    7373      this.ToolTip = new System.Windows.Forms.ToolTip(this.components);
     74      this.CheckboxColumnNames = new System.Windows.Forms.CheckBox();
    7475      ((System.ComponentModel.ISupportInitialize)(this.TrainingTestTrackBar)).BeginInit();
    7576      this.CSVSettingsGroupBox.SuspendLayout();
     
    9394      this.OkButton.DialogResult = System.Windows.Forms.DialogResult.OK;
    9495      this.OkButton.Enabled = false;
    95       this.OkButton.Location = new System.Drawing.Point(303, 407);
     96      this.OkButton.Location = new System.Drawing.Point(303, 422);
    9697      this.OkButton.Name = "OkButton";
    9798      this.OkButton.Size = new System.Drawing.Size(75, 23);
     
    137138      this.CancelationButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
    138139      this.CancelationButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
    139       this.CancelationButton.Location = new System.Drawing.Point(384, 407);
     140      this.CancelationButton.Location = new System.Drawing.Point(384, 422);
    140141      this.CancelationButton.Name = "CancelationButton";
    141142      this.CancelationButton.Size = new System.Drawing.Size(75, 23);
     
    248249      this.CSVSettingsGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    249250            | System.Windows.Forms.AnchorStyles.Right)));
     251      this.CSVSettingsGroupBox.Controls.Add(this.CheckboxColumnNames);
    250252      this.CSVSettingsGroupBox.Controls.Add(this.DateTimeFormatInfoLabel);
    251253      this.CSVSettingsGroupBox.Controls.Add(this.DecimalSeparatorInfoLabel);
     
    259261      this.CSVSettingsGroupBox.Location = new System.Drawing.Point(12, 32);
    260262      this.CSVSettingsGroupBox.Name = "CSVSettingsGroupBox";
    261       this.CSVSettingsGroupBox.Size = new System.Drawing.Size(447, 105);
     263      this.CSVSettingsGroupBox.Size = new System.Drawing.Size(447, 126);
    262264      this.CSVSettingsGroupBox.TabIndex = 16;
    263265      this.CSVSettingsGroupBox.TabStop = false;
     
    313315      this.ProblemDataSettingsGroupBox.Controls.Add(this.TrainingTestTrackBar);
    314316      this.ProblemDataSettingsGroupBox.Controls.Add(this.ShuffleDataCheckbox);
    315       this.ProblemDataSettingsGroupBox.Location = new System.Drawing.Point(12, 143);
     317      this.ProblemDataSettingsGroupBox.Location = new System.Drawing.Point(12, 164);
    316318      this.ProblemDataSettingsGroupBox.Name = "ProblemDataSettingsGroupBox";
    317       this.ProblemDataSettingsGroupBox.Size = new System.Drawing.Size(447, 258);
     319      this.ProblemDataSettingsGroupBox.Size = new System.Drawing.Size(447, 252);
    318320      this.ProblemDataSettingsGroupBox.TabIndex = 17;
    319321      this.ProblemDataSettingsGroupBox.TabStop = false;
     
    362364      this.PreviewDatasetMatrix.ShowRowsAndColumnsTextBox = false;
    363365      this.PreviewDatasetMatrix.ShowStatisticalInformation = false;
    364       this.PreviewDatasetMatrix.Size = new System.Drawing.Size(435, 144);
     366      this.PreviewDatasetMatrix.Size = new System.Drawing.Size(435, 138);
    365367      this.PreviewDatasetMatrix.TabIndex = 0;
     368      //
     369      // CheckboxColumnNames
     370      //
     371      this.CheckboxColumnNames.AutoSize = true;
     372      this.CheckboxColumnNames.Location = new System.Drawing.Point(9, 103);
     373      this.CheckboxColumnNames.Name = "CheckboxColumnNames";
     374      this.CheckboxColumnNames.Size = new System.Drawing.Size(144, 17);
     375      this.CheckboxColumnNames.TabIndex = 24;
     376      this.CheckboxColumnNames.Text = "Column names in first line";
     377      this.CheckboxColumnNames.UseVisualStyleBackColor = true;
     378      this.CheckboxColumnNames.CheckedChanged += new System.EventHandler(this.CheckboxColumnNames_CheckedChanged);
    366379      //
    367380      // DataAnalysisImportTypeDialog
     
    370383      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    371384      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    372       this.ClientSize = new System.Drawing.Size(471, 442);
     385      this.ClientSize = new System.Drawing.Size(471, 457);
    373386      this.Controls.Add(this.ProblemDataSettingsGroupBox);
    374387      this.Controls.Add(this.CSVSettingsGroupBox);
     
    422435    protected System.Windows.Forms.Label ShuffelInfoLabel;
    423436    protected System.Windows.Forms.ToolTip ToolTip;
     437    private System.Windows.Forms.CheckBox CheckboxColumnNames;
    424438  }
    425439}
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/DataAnalysisImportTypeDialog.cs

    r9458 r9608  
    6868          Separator = (char)SeparatorComboBox.SelectedValue,
    6969          NumberFormatInfo = (NumberFormatInfo)DecimalSeparatorComboBox.SelectedValue,
    70           DateTimeFormatInfo = (DateTimeFormatInfo)DateTimeFormatComboBox.SelectedValue
     70          DateTimeFormatInfo = (DateTimeFormatInfo)DateTimeFormatComboBox.SelectedValue,
     71          VariableNamesAvailable = CheckboxColumnNames.Checked
    7172        };
    7273      }
     
    99100      DateTimeFormatComboBox.Enabled = true;
    100101      ProblemTextBox.Text = openFileDialog.FileName;
     102      TableFileParser csvParser = new TableFileParser();
     103      CheckboxColumnNames.Checked = csvParser.AreColumnNamesInFirstLine(ProblemTextBox.Text,
     104                                                                      (NumberFormatInfo)DecimalSeparatorComboBox.SelectedValue,
     105                                                                      (DateTimeFormatInfo)DateTimeFormatComboBox.SelectedValue,
     106                                                                      (char)SeparatorComboBox.SelectedValue);
    101107      ParseCSVFile();
    102108    }
    103109
    104110    protected virtual void CSVFormatComboBoxSelectionChangeCommitted(object sender, EventArgs e) {
     111      if (string.IsNullOrEmpty(ProblemTextBox.Text)) return;
     112
     113      ParseCSVFile();
     114    }
     115
     116    protected virtual void CheckboxColumnNames_CheckedChanged(object sender, EventArgs e) {
    105117      if (string.IsNullOrEmpty(ProblemTextBox.Text)) return;
    106118
     
    115127                        (NumberFormatInfo)DecimalSeparatorComboBox.SelectedValue,
    116128                        (DateTimeFormatInfo)DateTimeFormatComboBox.SelectedValue,
    117                         (char)SeparatorComboBox.SelectedValue);
     129                        (char)SeparatorComboBox.SelectedValue,
     130                        CheckboxColumnNames.Checked);
    118131        IEnumerable<string> variableNamesWithType = GetVariableNamesWithType(csvParser);
    119132        PreviewDatasetMatrix.Content = new Dataset(variableNamesWithType, csvParser.Values);
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/RegressionImportTypeDialog.Designer.cs

    r9456 r9608  
    5353      this.SuspendLayout();
    5454      //
     55      // OkButton
     56      //
     57      this.OkButton.Location = new System.Drawing.Point(303, 421);
     58      //
     59      // CancelationButton
     60      //
     61      this.CancelationButton.Location = new System.Drawing.Point(384, 421);
     62      //
    5563      // ProblemDataSettingsGroupBox
    5664      //
     
    5866      this.ProblemDataSettingsGroupBox.Controls.Add(this.TargetVariableLabel);
    5967      this.ProblemDataSettingsGroupBox.Controls.Add(this.TargetVariableComboBox);
     68      this.ProblemDataSettingsGroupBox.Size = new System.Drawing.Size(447, 251);
    6069      this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.PreviewLabel, 0);
    6170      this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.ShuffelInfoLabel, 0);
     
    106115      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    107116      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    108       this.ClientSize = new System.Drawing.Size(471, 442);
     117      this.ClientSize = new System.Drawing.Size(471, 456);
    109118      this.Name = "RegressionImportTypeDialog";
    110119      this.Text = "Regression CSV Import";
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/TimeSeriesPrognosisImportTypeDialog.Designer.cs

    r9456 r9608  
    5959      this.ShuffleDataCheckbox.Visible = false;
    6060      //
     61      // OkButton
     62      //
     63      this.OkButton.Location = new System.Drawing.Point(303, 407);
     64      //
     65      // CancelationButton
     66      //
     67      this.CancelationButton.Location = new System.Drawing.Point(384, 407);
     68      //
    6169      // ProblemDataSettingsGroupBox
    6270      //
     
    6472      this.ProblemDataSettingsGroupBox.Controls.Add(this.TargetVariableComboBox);
    6573      this.ProblemDataSettingsGroupBox.Controls.Add(this.TargetVariableLabel);
     74      this.ProblemDataSettingsGroupBox.Size = new System.Drawing.Size(447, 237);
    6675      this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.ShuffleDataCheckbox, 0);
    6776      this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.TargetVariableLabel, 0);
     
    8089      this.ErrorTextBox.Location = new System.Drawing.Point(6, 19);
    8190      this.ErrorTextBox.Size = new System.Drawing.Size(435, 69);
     91      //
     92      // PreviewDatasetMatrix
     93      //
     94      this.PreviewDatasetMatrix.Size = new System.Drawing.Size(435, 123);
    8295      //
    8396      // SeparatorInfoLabel
     
    101114      // TargetVariableComboBox
    102115      //
    103       this.TargetVariableComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     116      this.TargetVariableComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
    104117            | System.Windows.Forms.AnchorStyles.Right)));
    105118      this.TargetVariableComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
Note: See TracChangeset for help on using the changeset viewer.