Index: /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/ClassificationImportTypeDialog.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/ClassificationImportTypeDialog.Designer.cs (revision 8884)
+++ /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/ClassificationImportTypeDialog.Designer.cs (revision 8885)
@@ -1,3 +1,24 @@
-namespace HeuristicLab.Problems.Instances.DataAnalysis.Views {
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see .
+ */
+#endregion
+
+namespace HeuristicLab.Problems.Instances.DataAnalysis.Views {
partial class ClassificationImportTypeDialog {
///
@@ -24,7 +45,10 @@
///
private void InitializeComponent() {
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ClassificationImportTypeDialog));
this.TargetVariableComboBox = new System.Windows.Forms.ComboBox();
this.TargetVariableLabel = new System.Windows.Forms.Label();
this.TargetVariableInfoLabel = new System.Windows.Forms.Label();
+ this.UniformDistributionOfClassesCheckbox = new System.Windows.Forms.CheckBox();
+ this.UniformDistributClassValuesInfoLabel = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.TrainingTestTrackBar)).BeginInit();
this.CSVSettingsGroupBox.SuspendLayout();
@@ -32,30 +56,73 @@
this.SuspendLayout();
//
+ // ShuffleDataCheckbox
+ //
+ this.ShuffleDataCheckbox.CheckedChanged += new System.EventHandler(this.ShuffleDataCheckbox_CheckedChanged);
+ //
+ // OkButton
+ //
+ this.OkButton.Location = new System.Drawing.Point(303, 464);
+ //
+ // TrainingTestTrackBar
+ //
+ this.TrainingTestTrackBar.Location = new System.Drawing.Point(6, 70);
+ //
+ // TestLabel
+ //
+ this.TestLabel.Location = new System.Drawing.Point(303, 95);
+ //
+ // TrainingLabel
+ //
+ this.TrainingLabel.Location = new System.Drawing.Point(76, 95);
+ //
+ // CancelationButton
+ //
+ this.CancelationButton.Location = new System.Drawing.Point(384, 464);
+ //
// ProblemDataSettingsGroupBox
//
+ this.ProblemDataSettingsGroupBox.Controls.Add(this.UniformDistributClassValuesInfoLabel);
this.ProblemDataSettingsGroupBox.Controls.Add(this.TargetVariableInfoLabel);
this.ProblemDataSettingsGroupBox.Controls.Add(this.TargetVariableLabel);
this.ProblemDataSettingsGroupBox.Controls.Add(this.TargetVariableComboBox);
- this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.PreviewLabel, 0);
- this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.ShuffelInfoLabel, 0);
+ this.ProblemDataSettingsGroupBox.Controls.Add(this.UniformDistributionOfClassesCheckbox);
+ this.ProblemDataSettingsGroupBox.Size = new System.Drawing.Size(447, 315);
+ this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.UniformDistributionOfClassesCheckbox, 0);
this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.TargetVariableComboBox, 0);
- this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.ShuffleDataCheckbox, 0);
this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.TargetVariableLabel, 0);
this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.TargetVariableInfoLabel, 0);
+ this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.UniformDistributClassValuesInfoLabel, 0);
+ this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.PreviewLabel, 0);
this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.TrainingTestTrackBar, 0);
this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.TrainingLabel, 0);
+ this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.TestLabel, 0);
+ this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.ShuffelInfoLabel, 0);
+ this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.ShuffleDataCheckbox, 0);
this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.PreviewDatasetMatrix, 0);
- this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.TestLabel, 0);
this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.ErrorTextBox, 0);
//
+ // ErrorTextBox
+ //
+ this.ErrorTextBox.Location = new System.Drawing.Point(6, 19);
+ this.ErrorTextBox.Size = new System.Drawing.Size(435, 96);
+ //
+ // PreviewDatasetMatrix
+ //
+ this.PreviewDatasetMatrix.Location = new System.Drawing.Point(6, 134);
+ this.PreviewDatasetMatrix.Size = new System.Drawing.Size(435, 175);
+ //
+ // PreviewLabel
+ //
+ this.PreviewLabel.Location = new System.Drawing.Point(6, 118);
+ //
// TargetVariableComboBox
//
this.TargetVariableComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
+ | System.Windows.Forms.AnchorStyles.Right)));
this.TargetVariableComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.TargetVariableComboBox.FormattingEnabled = true;
- this.TargetVariableComboBox.Location = new System.Drawing.Point(230, 19);
+ this.TargetVariableComboBox.Location = new System.Drawing.Point(94, 43);
this.TargetVariableComboBox.Name = "TargetVariableComboBox";
- this.TargetVariableComboBox.Size = new System.Drawing.Size(181, 21);
+ this.TargetVariableComboBox.Size = new System.Drawing.Size(317, 21);
this.TargetVariableComboBox.TabIndex = 10;
//
@@ -63,5 +130,5 @@
//
this.TargetVariableLabel.AutoSize = true;
- this.TargetVariableLabel.Location = new System.Drawing.Point(142, 22);
+ this.TargetVariableLabel.Location = new System.Drawing.Point(6, 46);
this.TargetVariableLabel.Name = "TargetVariableLabel";
this.TargetVariableLabel.Size = new System.Drawing.Size(82, 13);
@@ -69,13 +136,41 @@
this.TargetVariableLabel.Text = "Target Variable:";
//
- // TargetVariableinfoLabel
- //
- this.TargetVariableInfoLabel.Location = new System.Drawing.Point(421, 21);
- this.TargetVariableInfoLabel.Name = "Target Variable Info";
+ // TargetVariableInfoLabel
+ //
+ this.TargetVariableInfoLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.TargetVariableInfoLabel.Image = HeuristicLab.Common.Resources.VSImageLibrary.Information;
+ this.TargetVariableInfoLabel.Location = new System.Drawing.Point(421, 45);
+ this.TargetVariableInfoLabel.Name = "TargetVariableInfoLabel";
this.TargetVariableInfoLabel.Size = new System.Drawing.Size(16, 16);
this.TargetVariableInfoLabel.TabIndex = 21;
this.TargetVariableInfoLabel.Tag = "Select the target variable of the csv file.";
- this.TargetVariableInfoLabel.Image = HeuristicLab.Common.Resources.VSImageLibrary.Information;
+ this.ToolTip.SetToolTip(this.TargetVariableInfoLabel, (string)this.TargetVariableInfoLabel.Tag);
this.TargetVariableInfoLabel.DoubleClick += new System.EventHandler(this.ControlToolTip_DoubleClick);
+ //
+ // UniformDistributionOfClassesCheckbox
+ //
+ this.UniformDistributionOfClassesCheckbox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.UniformDistributionOfClassesCheckbox.AutoSize = true;
+ this.UniformDistributionOfClassesCheckbox.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
+ this.UniformDistributionOfClassesCheckbox.Enabled = false;
+ this.UniformDistributionOfClassesCheckbox.Location = new System.Drawing.Point(259, 19);
+ this.UniformDistributionOfClassesCheckbox.Name = "UniformDistributionOfClassesCheckbox";
+ this.UniformDistributionOfClassesCheckbox.Size = new System.Drawing.Size(152, 17);
+ this.UniformDistributionOfClassesCheckbox.TabIndex = 22;
+ this.UniformDistributionOfClassesCheckbox.Text = "Uniformly distribute classes";
+ this.UniformDistributionOfClassesCheckbox.UseVisualStyleBackColor = true;
+ //
+ // UniformDistributClassValuesInfoLabel
+ //
+ this.UniformDistributClassValuesInfoLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.UniformDistributClassValuesInfoLabel.Image = HeuristicLab.Common.Resources.VSImageLibrary.Information;
+ this.UniformDistributClassValuesInfoLabel.Location = new System.Drawing.Point(421, 20);
+ this.UniformDistributClassValuesInfoLabel.Name = "UniformDistributClassValuesInfoLabel";
+ this.UniformDistributClassValuesInfoLabel.Size = new System.Drawing.Size(16, 16);
+ this.UniformDistributClassValuesInfoLabel.TabIndex = 23;
+ this.UniformDistributClassValuesInfoLabel.Tag = "Check, if classes should be distributed uniformly between training and test. This" +
+ " can change the distribution of training and test a little bit.";
+ this.ToolTip.SetToolTip(this.UniformDistributClassValuesInfoLabel, (string)this.UniformDistributClassValuesInfoLabel.Tag);
+ this.UniformDistributClassValuesInfoLabel.DoubleClick += new System.EventHandler(this.ControlToolTip_DoubleClick);
//
// ClassificationImportTypeDialog
@@ -83,5 +178,5 @@
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(471, 442);
+ this.ClientSize = new System.Drawing.Size(471, 499);
this.Name = "ClassificationImportTypeDialog";
this.Text = "Classification CSV Import";
@@ -95,12 +190,11 @@
}
-
#endregion
- private System.Windows.Forms.ComboBox TargetVariableComboBox;
- private System.Windows.Forms.Label TargetVariableLabel;
+ protected System.Windows.Forms.ComboBox TargetVariableComboBox;
+ protected System.Windows.Forms.Label TargetVariableLabel;
protected System.Windows.Forms.Label TargetVariableInfoLabel;
-
-
+ protected System.Windows.Forms.Label UniformDistributClassValuesInfoLabel;
+ protected System.Windows.Forms.CheckBox UniformDistributionOfClassesCheckbox;
}
}
Index: /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/ClassificationImportTypeDialog.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/ClassificationImportTypeDialog.cs (revision 8884)
+++ /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/ClassificationImportTypeDialog.cs (revision 8885)
@@ -33,5 +33,6 @@
Shuffle = ShuffleDataCheckbox.Checked,
Training = TrainingTestTrackBar.Value,
- TargetVariable = (String)TargetVariableComboBox.SelectedValue
+ TargetVariable = (String)TargetVariableComboBox.SelectedValue,
+ UniformlyDistributeClasses = UniformDistributionOfClassesCheckbox.Checked
};
}
@@ -40,6 +41,4 @@
public ClassificationImportTypeDialog() {
InitializeComponent();
-
- ToolTip.SetToolTip(TargetVariableInfoLabel, (string)TargetVariableInfoLabel.Tag);
}
@@ -58,4 +57,8 @@
}
}
+
+ private void ShuffleDataCheckbox_CheckedChanged(object sender, System.EventArgs e) {
+ UniformDistributionOfClassesCheckbox.Enabled = ShuffleDataCheckbox.Checked;
+ }
}
}
Index: /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/ClassificationInstanceConsumerView.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/ClassificationInstanceConsumerView.Designer.cs (revision 8884)
+++ /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/ClassificationInstanceConsumerView.Designer.cs (revision 8885)
@@ -1,3 +1,24 @@
-namespace HeuristicLab.Problems.Instances.DataAnalysis.Views {
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see .
+ */
+#endregion
+
+namespace HeuristicLab.Problems.Instances.DataAnalysis.Views {
partial class ClassificationInstanceConsumerView {
///
Index: /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/ClassificationInstanceConsumerView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/ClassificationInstanceConsumerView.cs (revision 8884)
+++ /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/ClassificationInstanceConsumerView.cs (revision 8885)
@@ -48,6 +48,6 @@
instance = provider.ImportData(importTypeDialog.Path, importTypeDialog.ImportType, importTypeDialog.CSVFormat);
}
- catch (Exception ex) {
- MessageBox.Show(String.Format("There was an error parsing the file: {0}", Environment.NewLine + ex.Message), "Error while parsing", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ catch (IOException ex) {
+ ErrorWhileParsing(ex);
return;
}
@@ -55,6 +55,6 @@
GenericConsumer.Load(instance);
}
- catch (Exception ex) {
- MessageBox.Show(String.Format("This problem does not support loading the instance {0}: {1}", Path.GetFileName(importTypeDialog.Path), Environment.NewLine + ex.Message), "Cannot load instance");
+ catch (IOException ex) {
+ ErrorWhileLoading(ex, importTypeDialog.Path);
}
} else {
Index: /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/DataAnalysisImportTypeDialog.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/DataAnalysisImportTypeDialog.Designer.cs (revision 8884)
+++ /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/DataAnalysisImportTypeDialog.Designer.cs (revision 8885)
@@ -1,3 +1,23 @@
-
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see .
+ */
+#endregion
+
namespace HeuristicLab.Problems.Instances.DataAnalysis.Views {
partial class DataAnalysisImportTypeDialog {
@@ -26,5 +46,4 @@
private void InitializeComponent() {
this.components = new System.ComponentModel.Container();
- System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DataAnalysisImportTypeDialog));
this.ShuffleDataCheckbox = new System.Windows.Forms.CheckBox();
this.OkButton = new System.Windows.Forms.Button();
@@ -32,5 +51,5 @@
this.TestLabel = new System.Windows.Forms.Label();
this.TrainingLabel = new System.Windows.Forms.Label();
- this.CancelButton = new System.Windows.Forms.Button();
+ this.CancelationButton = new System.Windows.Forms.Button();
this.OpenFileButton = new System.Windows.Forms.Button();
this.ProblemFileLabel = new System.Windows.Forms.Label();
@@ -74,5 +93,5 @@
this.OkButton.DialogResult = System.Windows.Forms.DialogResult.OK;
this.OkButton.Enabled = false;
- this.OkButton.Location = new System.Drawing.Point(87, 407);
+ this.OkButton.Location = new System.Drawing.Point(303, 407);
this.OkButton.Name = "OkButton";
this.OkButton.Size = new System.Drawing.Size(75, 23);
@@ -84,5 +103,5 @@
//
this.TrainingTestTrackBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
+ | System.Windows.Forms.AnchorStyles.Right)));
this.TrainingTestTrackBar.Location = new System.Drawing.Point(6, 43);
this.TrainingTestTrackBar.Maximum = 100;
@@ -114,14 +133,14 @@
this.TrainingLabel.Text = "Training: 66 %";
//
- // CancelButton
- //
- this.CancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.CancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
- this.CancelButton.Location = new System.Drawing.Point(318, 407);
- this.CancelButton.Name = "CancelButton";
- this.CancelButton.Size = new System.Drawing.Size(75, 23);
- this.CancelButton.TabIndex = 3;
- this.CancelButton.Text = "&Cancel";
- this.CancelButton.UseVisualStyleBackColor = true;
+ // CancelationButton
+ //
+ this.CancelationButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.CancelationButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+ this.CancelationButton.Location = new System.Drawing.Point(384, 407);
+ this.CancelationButton.Name = "CancelationButton";
+ this.CancelationButton.Size = new System.Drawing.Size(75, 23);
+ this.CancelationButton.TabIndex = 3;
+ this.CancelationButton.Text = "&Cancel";
+ this.CancelationButton.UseVisualStyleBackColor = true;
//
// OpenFileButton
@@ -148,5 +167,5 @@
//
this.ProblemTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
+ | System.Windows.Forms.AnchorStyles.Right)));
this.ProblemTextBox.Location = new System.Drawing.Point(91, 6);
this.ProblemTextBox.Name = "ProblemTextBox";
@@ -162,5 +181,5 @@
//
this.DateTimeFormatComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
+ | System.Windows.Forms.AnchorStyles.Right)));
this.DateTimeFormatComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.DateTimeFormatComboBox.FormattingEnabled = true;
@@ -174,5 +193,5 @@
//
this.DecimalSeparatorComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
+ | System.Windows.Forms.AnchorStyles.Right)));
this.DecimalSeparatorComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.DecimalSeparatorComboBox.FormattingEnabled = true;
@@ -213,5 +232,5 @@
//
this.SeparatorComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
+ | System.Windows.Forms.AnchorStyles.Right)));
this.SeparatorComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.SeparatorComboBox.FormattingEnabled = true;
@@ -225,5 +244,5 @@
//
this.CSVSettingsGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
+ | System.Windows.Forms.AnchorStyles.Right)));
this.CSVSettingsGroupBox.Controls.Add(this.DateTimeFormatInfoLabel);
this.CSVSettingsGroupBox.Controls.Add(this.DecimalSeparatorInfoLabel);
@@ -245,10 +264,11 @@
//
this.DateTimeFormatInfoLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.DateTimeFormatInfoLabel.Image = HeuristicLab.Common.Resources.VSImageLibrary.Information;
this.DateTimeFormatInfoLabel.Location = new System.Drawing.Point(421, 76);
- this.DateTimeFormatInfoLabel.Name = "DateTime Format Info";
+ this.DateTimeFormatInfoLabel.Name = "DateTimeFormatInfoLabel";
this.DateTimeFormatInfoLabel.Size = new System.Drawing.Size(16, 16);
this.DateTimeFormatInfoLabel.TabIndex = 23;
this.DateTimeFormatInfoLabel.Tag = "Select the date time format used in the csv file";
- this.DateTimeFormatInfoLabel.Image = HeuristicLab.Common.Resources.VSImageLibrary.Information;
+ this.ToolTip.SetToolTip(this.DateTimeFormatInfoLabel, "Select the date time format used in the csv file");
this.DateTimeFormatInfoLabel.DoubleClick += new System.EventHandler(this.ControlToolTip_DoubleClick);
//
@@ -256,10 +276,11 @@
//
this.DecimalSeparatorInfoLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.DecimalSeparatorInfoLabel.Image = HeuristicLab.Common.Resources.VSImageLibrary.Information;
this.DecimalSeparatorInfoLabel.Location = new System.Drawing.Point(421, 49);
- this.DecimalSeparatorInfoLabel.Name = "Decimal Separator Info";
+ this.DecimalSeparatorInfoLabel.Name = "DecimalSeparatorInfoLabel";
this.DecimalSeparatorInfoLabel.Size = new System.Drawing.Size(16, 16);
this.DecimalSeparatorInfoLabel.TabIndex = 22;
this.DecimalSeparatorInfoLabel.Tag = "Select the decimal separator used to for double values";
- this.DecimalSeparatorInfoLabel.Image = HeuristicLab.Common.Resources.VSImageLibrary.Information;
+ this.ToolTip.SetToolTip(this.DecimalSeparatorInfoLabel, "Select the decimal separator used to for double values");
this.DecimalSeparatorInfoLabel.DoubleClick += new System.EventHandler(this.ControlToolTip_DoubleClick);
//
@@ -267,10 +288,11 @@
//
this.SeparatorInfoLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.SeparatorInfoLabel.Image = HeuristicLab.Common.Resources.VSImageLibrary.Information;
this.SeparatorInfoLabel.Location = new System.Drawing.Point(421, 22);
- this.SeparatorInfoLabel.Name = "Separator Info";
+ this.SeparatorInfoLabel.Name = "SeparatorInfoLabel";
this.SeparatorInfoLabel.Size = new System.Drawing.Size(16, 16);
this.SeparatorInfoLabel.TabIndex = 21;
this.SeparatorInfoLabel.Tag = "Select the separator used to separate columns in the csv file.";
- this.SeparatorInfoLabel.Image = HeuristicLab.Common.Resources.VSImageLibrary.Information;
+ this.ToolTip.SetToolTip(this.SeparatorInfoLabel, "Select the separator used to separate columns in the csv file.");
this.SeparatorInfoLabel.DoubleClick += new System.EventHandler(this.ControlToolTip_DoubleClick);
//
@@ -278,6 +300,6 @@
//
this.ProblemDataSettingsGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
this.ProblemDataSettingsGroupBox.Controls.Add(this.ErrorTextBox);
this.ProblemDataSettingsGroupBox.Controls.Add(this.ShuffelInfoLabel);
@@ -306,10 +328,11 @@
// ShuffelInfoLabel
//
+ this.ShuffelInfoLabel.Image = HeuristicLab.Common.Resources.VSImageLibrary.Information;
this.ShuffelInfoLabel.Location = new System.Drawing.Point(111, 20);
- this.ShuffelInfoLabel.Name = "Shuffle Info";
+ this.ShuffelInfoLabel.Name = "ShuffelInfoLabel";
this.ShuffelInfoLabel.Size = new System.Drawing.Size(16, 16);
this.ShuffelInfoLabel.TabIndex = 8;
this.ShuffelInfoLabel.Tag = "Check, if the importat data should be shuffled";
- this.ShuffelInfoLabel.Image = HeuristicLab.Common.Resources.VSImageLibrary.Information;
+ this.ToolTip.SetToolTip(this.ShuffelInfoLabel, "Check, if the importat data should be shuffled");
this.ShuffelInfoLabel.DoubleClick += new System.EventHandler(this.ControlToolTip_DoubleClick);
//
@@ -326,6 +349,6 @@
//
this.PreviewDatasetMatrix.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
this.PreviewDatasetMatrix.Caption = "Dataset Preview";
this.PreviewDatasetMatrix.Content = null;
@@ -350,5 +373,5 @@
this.Controls.Add(this.OpenFileButton);
this.Controls.Add(this.ProblemFileLabel);
- this.Controls.Add(this.CancelButton);
+ this.Controls.Add(this.CancelationButton);
this.Controls.Add(this.OkButton);
this.MaximizeBox = false;
@@ -375,5 +398,5 @@
protected System.Windows.Forms.Label TestLabel;
protected System.Windows.Forms.Label TrainingLabel;
- protected System.Windows.Forms.Button CancelButton;
+ protected System.Windows.Forms.Button CancelationButton;
protected System.Windows.Forms.OpenFileDialog openFileDialog;
protected System.Windows.Forms.Label ProblemFileLabel;
Index: /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/DataAnalysisImportTypeDialog.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/DataAnalysisImportTypeDialog.cs (revision 8884)
+++ /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/DataAnalysisImportTypeDialog.cs (revision 8885)
@@ -22,5 +22,4 @@
using System;
using System.Collections.Generic;
-using System.ComponentModel;
using System.Globalization;
using System.Linq;
@@ -32,5 +31,5 @@
public partial class DataAnalysisImportTypeDialog : Form {
- public static readonly BindingList> dateTimeFormats = new BindingList>{
+ public static readonly List> dateTimeFormats = new List>{
new KeyValuePair(DateTimeFormatInfo.GetInstance(new CultureInfo("de-DE")), "dd/mm/yyyy hh:MM:ss" ),
new KeyValuePair(DateTimeFormatInfo.InvariantInfo, "mm/dd/yyyy hh:MM:ss" ),
@@ -39,5 +38,5 @@
};
- public static readonly BindingList> POSSIBLE_SEPARATORS = new BindingList>{
+ public static readonly List> POSSIBLE_SEPARATORS = new List>{
new KeyValuePair(',', ", (Comma)" ),
new KeyValuePair(';', "; (Semicolon)" ),
@@ -45,5 +44,5 @@
};
- public static readonly BindingList> POSSIBLE_DECIMAL_SEPARATORS = new BindingList>{
+ public static readonly List> POSSIBLE_DECIMAL_SEPARATORS = new List>{
new KeyValuePair(NumberFormatInfo.InvariantInfo, ". (Period)" ),
new KeyValuePair(NumberFormatInfo.GetInstance(new CultureInfo("de-DE")), ", (Comma)" )
@@ -75,8 +74,4 @@
public DataAnalysisImportTypeDialog() {
InitializeComponent();
- ToolTip.SetToolTip(SeparatorInfoLabel, (string)SeparatorInfoLabel.Tag);
- ToolTip.SetToolTip(DecimalSeparatorInfoLabel, (string)DecimalSeparatorInfoLabel.Tag);
- ToolTip.SetToolTip(DateTimeFormatInfoLabel, (string)DateTimeFormatInfoLabel.Tag);
- ToolTip.SetToolTip(ShuffelInfoLabel, (string)ShuffelInfoLabel.Tag);
SeparatorComboBox.DataSource = POSSIBLE_SEPARATORS;
Index: /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/DataAnalysisInstanceConsumerView.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/DataAnalysisInstanceConsumerView.Designer.cs (revision 8884)
+++ /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/DataAnalysisInstanceConsumerView.Designer.cs (revision 8885)
@@ -1,3 +1,24 @@
-namespace HeuristicLab.Problems.Instances.DataAnalysis.Views {
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see .
+ */
+#endregion
+
+namespace HeuristicLab.Problems.Instances.DataAnalysis.Views {
partial class DataAnalysisInstanceConsumerView {
///
Index: /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/DataAnalysisInstanceConsumerView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/DataAnalysisInstanceConsumerView.cs (revision 8884)
+++ /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/DataAnalysisInstanceConsumerView.cs (revision 8885)
@@ -40,5 +40,4 @@
public DataAnalysisInstanceConsumerView() {
InitializeComponent();
-
}
@@ -51,8 +50,7 @@
try {
instance = provider.ImportData(importTypeDialog.Path, importTypeDialog.ImportType, importTypeDialog.CSVFormat);
-
}
- catch (Exception ex) {
- MessageBox.Show(String.Format("There was an error parsing the file: {0}", Environment.NewLine + ex.Message), "Error while parsing", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ catch (IOException ex) {
+ ErrorWhileParsing(ex);
return;
}
@@ -60,6 +58,6 @@
GenericConsumer.Load(instance);
}
- catch (Exception ex) {
- MessageBox.Show(String.Format("This problem does not support loading the instance {0}: {1}", Path.GetFileName(importTypeDialog.Path), Environment.NewLine + ex.Message), "Cannot load instance");
+ catch (IOException ex) {
+ ErrorWhileLoading(ex, importTypeDialog.Path);
}
} else {
@@ -70,4 +68,11 @@
}
}
+
+ protected void ErrorWhileParsing(Exception ex) {
+ MessageBox.Show(String.Format("There was an error parsing the file: {0}", Environment.NewLine + ex.Message), "Error while parsing", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ protected void ErrorWhileLoading(Exception ex, string path) {
+ MessageBox.Show(String.Format("This problem does not support loading the instance {0}: {1}", Path.GetFileName(path), Environment.NewLine + ex.Message), "Cannot load instance");
+ }
}
}
Index: /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/HeuristicLab.Problems.Instances.DataAnalysis.Views-3.3.csproj
===================================================================
--- /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/HeuristicLab.Problems.Instances.DataAnalysis.Views-3.3.csproj (revision 8884)
+++ /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/HeuristicLab.Problems.Instances.DataAnalysis.Views-3.3.csproj (revision 8885)
@@ -70,8 +70,13 @@
+
+
+
+
+
@@ -92,4 +97,16 @@
ClassificationInstanceConsumerView.cs
+
+
+ Form
+
+
+ TimeSeriesPrognosisImportTypeDialog.cs
+
+
+ UserControl
+
+
+ TimeSeriesPrognosisInstanceConsumerView.cs
@@ -155,4 +172,8 @@
{3BD61258-31DA-4B09-89C0-4F71FEF5F05A}
HeuristicLab.MainForm-3.3
+
+
+ {662B4B15-8F4D-4AE5-B3EB-D91C215F5AF2}
+ HeuristicLab.Optimization.Views-3.3
Index: /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/RegressionImportTypeDialog.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/RegressionImportTypeDialog.Designer.cs (revision 8884)
+++ /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/RegressionImportTypeDialog.Designer.cs (revision 8885)
@@ -1,3 +1,24 @@
-namespace HeuristicLab.Problems.Instances.DataAnalysis.Views {
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see .
+ */
+#endregion
+
+namespace HeuristicLab.Problems.Instances.DataAnalysis.Views {
partial class RegressionImportTypeDialog {
///
@@ -79,4 +100,5 @@
this.TargetVariableInfoLabel.Image = HeuristicLab.Common.Resources.VSImageLibrary.Information;
this.TargetVariableInfoLabel.DoubleClick += new System.EventHandler(this.ControlToolTip_DoubleClick);
+ this.ToolTip.SetToolTip(this.TargetVariableInfoLabel, (string)this.TargetVariableInfoLabel.Tag);
//
// RegressionImportTypeDialog
@@ -86,5 +108,5 @@
this.ClientSize = new System.Drawing.Size(471, 442);
this.Name = "RegressionImportTypeDialog";
- this.Text = "Classification CSV Import";
+ this.Text = "Regression CSV Import";
((System.ComponentModel.ISupportInitialize)(this.TrainingTestTrackBar)).EndInit();
this.CSVSettingsGroupBox.ResumeLayout(false);
@@ -99,6 +121,6 @@
#endregion
- private System.Windows.Forms.ComboBox TargetVariableComboBox;
- private System.Windows.Forms.Label TargetVariableLabel;
+ protected System.Windows.Forms.ComboBox TargetVariableComboBox;
+ protected System.Windows.Forms.Label TargetVariableLabel;
protected System.Windows.Forms.Label TargetVariableInfoLabel;
Index: /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/RegressionImportTypeDialog.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/RegressionImportTypeDialog.cs (revision 8884)
+++ /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/RegressionImportTypeDialog.cs (revision 8885)
@@ -25,5 +25,4 @@
namespace HeuristicLab.Problems.Instances.DataAnalysis.Views {
-
public partial class RegressionImportTypeDialog : DataAnalysisImportTypeDialog {
public new RegressionImportType ImportType {
@@ -39,6 +38,4 @@
public RegressionImportTypeDialog() {
InitializeComponent();
-
- ToolTip.SetToolTip(TargetVariableInfoLabel, (string)TargetVariableInfoLabel.Tag);
}
Index: /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/RegressionInstanceConsumerView.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/RegressionInstanceConsumerView.Designer.cs (revision 8884)
+++ /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/RegressionInstanceConsumerView.Designer.cs (revision 8885)
@@ -1,3 +1,24 @@
-namespace HeuristicLab.Problems.Instances.DataAnalysis.Views {
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see .
+ */
+#endregion
+
+namespace HeuristicLab.Problems.Instances.DataAnalysis.Views {
partial class RegressionInstanceConsumerView {
///
Index: /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/RegressionInstanceConsumerView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/RegressionInstanceConsumerView.cs (revision 8884)
+++ /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/RegressionInstanceConsumerView.cs (revision 8885)
@@ -48,6 +48,6 @@
instance = provider.ImportData(importTypeDialog.Path, importTypeDialog.ImportType, importTypeDialog.CSVFormat);
}
- catch (Exception ex) {
- MessageBox.Show(String.Format("There was an error parsing the file: {0}", Environment.NewLine + ex.Message), "Error while parsing", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ catch (IOException ex) {
+ ErrorWhileParsing(ex);
return;
}
@@ -55,6 +55,6 @@
GenericConsumer.Load(instance);
}
- catch (Exception ex) {
- MessageBox.Show(String.Format("This problem does not support loading the instance {0}: {1}", Path.GetFileName(importTypeDialog.Path), Environment.NewLine + ex.Message), "Cannot load instance");
+ catch (IOException ex) {
+ ErrorWhileLoading(ex, importTypeDialog.Path);
}
} else {
Index: /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/TimeSeriesPrognosisImportTypeDialog.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/TimeSeriesPrognosisImportTypeDialog.Designer.cs (revision 8885)
+++ /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/TimeSeriesPrognosisImportTypeDialog.Designer.cs (revision 8885)
@@ -0,0 +1,158 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see .
+ */
+#endregion
+
+namespace HeuristicLab.Problems.Instances.DataAnalysis.Views {
+ partial class TimeSeriesPrognosisImportTypeDialog {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing) {
+ if (disposing && (components != null)) {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent() {
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TimeSeriesPrognosisImportTypeDialog));
+ this.TargetVariableComboBox = new System.Windows.Forms.ComboBox();
+ this.TargetVariableLabel = new System.Windows.Forms.Label();
+ this.TargetVariableInfoLabel = new System.Windows.Forms.Label();
+ ((System.ComponentModel.ISupportInitialize)(this.TrainingTestTrackBar)).BeginInit();
+ this.CSVSettingsGroupBox.SuspendLayout();
+ this.ProblemDataSettingsGroupBox.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // ShuffleDataCheckbox
+ //
+ this.ShuffleDataCheckbox.Enabled = false;
+ this.ShuffleDataCheckbox.Visible = false;
+ //
+ // ProblemDataSettingsGroupBox
+ //
+ this.ProblemDataSettingsGroupBox.Controls.Add(this.TargetVariableInfoLabel);
+ this.ProblemDataSettingsGroupBox.Controls.Add(this.TargetVariableComboBox);
+ this.ProblemDataSettingsGroupBox.Controls.Add(this.TargetVariableLabel);
+ this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.ShuffleDataCheckbox, 0);
+ this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.TargetVariableLabel, 0);
+ this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.PreviewLabel, 0);
+ this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.ShuffelInfoLabel, 0);
+ this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.TargetVariableComboBox, 0);
+ this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.TargetVariableInfoLabel, 0);
+ this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.TrainingTestTrackBar, 0);
+ this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.TrainingLabel, 0);
+ this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.PreviewDatasetMatrix, 0);
+ this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.TestLabel, 0);
+ this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.ErrorTextBox, 0);
+ //
+ // ErrorTextBox
+ //
+ this.ErrorTextBox.Location = new System.Drawing.Point(6, 19);
+ this.ErrorTextBox.Size = new System.Drawing.Size(435, 69);
+ //
+ // SeparatorInfoLabel
+ //
+ this.ToolTip.SetToolTip(this.SeparatorInfoLabel, "Select the separator used to separate columns in the csv file.");
+ //
+ // DateTimeFormatInfoLabel
+ //
+ this.ToolTip.SetToolTip(this.DateTimeFormatInfoLabel, "Select the date time format used in the csv file");
+ //
+ // DecimalSeparatorInfoLabel
+ //
+ this.ToolTip.SetToolTip(this.DecimalSeparatorInfoLabel, "Select the decimal separator used to for double values");
+ //
+ // ShuffelInfoLabel
+ //
+ this.ShuffelInfoLabel.Enabled = false;
+ this.ToolTip.SetToolTip(this.ShuffelInfoLabel, "Check, if the importat data should be shuffled");
+ this.ShuffelInfoLabel.Visible = false;
+ //
+ // TargetVariableComboBox
+ //
+ this.TargetVariableComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.TargetVariableComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.TargetVariableComboBox.FormattingEnabled = true;
+ this.TargetVariableComboBox.Location = new System.Drawing.Point(111, 19);
+ this.TargetVariableComboBox.Name = "TargetVariableComboBox";
+ this.TargetVariableComboBox.Size = new System.Drawing.Size(300, 21);
+ this.TargetVariableComboBox.TabIndex = 10;
+ //
+ // TargetVariableLabel
+ //
+ this.TargetVariableLabel.AutoSize = true;
+ this.TargetVariableLabel.Location = new System.Drawing.Point(6, 22);
+ this.TargetVariableLabel.Name = "TargetVariableLabel";
+ this.TargetVariableLabel.Size = new System.Drawing.Size(82, 13);
+ this.TargetVariableLabel.TabIndex = 20;
+ this.TargetVariableLabel.Text = "Target Variable:";
+ //
+ // TargetVariableInfoLabel
+ //
+ this.TargetVariableInfoLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.TargetVariableInfoLabel.Image = HeuristicLab.Common.Resources.VSImageLibrary.Information;
+ this.TargetVariableInfoLabel.Location = new System.Drawing.Point(421, 22);
+ this.TargetVariableInfoLabel.Name = "TargetVariableInfoLabel";
+ this.TargetVariableInfoLabel.Size = new System.Drawing.Size(16, 16);
+ this.TargetVariableInfoLabel.TabIndex = 21;
+ this.TargetVariableInfoLabel.Tag = "Select the target variable of the csv file.";
+ this.TargetVariableInfoLabel.DoubleClick += new System.EventHandler(this.ControlToolTip_DoubleClick);
+ this.ToolTip.SetToolTip(this.TargetVariableInfoLabel, (string)this.TargetVariableInfoLabel.Tag);
+ //
+ // TimeSeriesPrognosisImportTypeDialog
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(471, 442);
+ this.Name = "TimeSeriesPrognosisImportTypeDialog";
+ this.Text = "TimeSeries Prognosis CSV Import";
+ ((System.ComponentModel.ISupportInitialize)(this.TrainingTestTrackBar)).EndInit();
+ this.CSVSettingsGroupBox.ResumeLayout(false);
+ this.CSVSettingsGroupBox.PerformLayout();
+ this.ProblemDataSettingsGroupBox.ResumeLayout(false);
+ this.ProblemDataSettingsGroupBox.PerformLayout();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ protected System.Windows.Forms.ComboBox TargetVariableComboBox;
+ protected System.Windows.Forms.Label TargetVariableLabel;
+ protected System.Windows.Forms.Label TargetVariableInfoLabel;
+
+
+ }
+}
Index: /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/TimeSeriesPrognosisImportTypeDialog.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/TimeSeriesPrognosisImportTypeDialog.cs (revision 8885)
+++ /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/TimeSeriesPrognosisImportTypeDialog.cs (revision 8885)
@@ -0,0 +1,56 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see .
+ */
+#endregion
+
+using System;
+using System.Linq;
+using HeuristicLab.Problems.DataAnalysis;
+
+namespace HeuristicLab.Problems.Instances.DataAnalysis.Views {
+ public partial class TimeSeriesPrognosisImportTypeDialog : DataAnalysisImportTypeDialog {
+ public new TimeSeriesPrognosisImportType ImportType {
+ get {
+ return new TimeSeriesPrognosisImportType() {
+ //time series prognosis problems shall not be shuffled
+ Shuffle = false,
+ Training = TrainingTestTrackBar.Value,
+ TargetVariable = (String)TargetVariableComboBox.SelectedValue
+ };
+ }
+ }
+
+ public TimeSeriesPrognosisImportTypeDialog() {
+ InitializeComponent();
+ }
+
+ protected override void CheckAdditionalConstraints(TableFileParser csvParser) {
+ base.CheckAdditionalConstraints(csvParser);
+ SetPossibleTargetVariables();
+ }
+
+ protected void SetPossibleTargetVariables() {
+ var dataset = PreviewDatasetMatrix.Content as Dataset;
+ if (dataset != null) {
+ // Remove " (Double)" at the end of the variable name (last 9 chars)
+ TargetVariableComboBox.DataSource = dataset.DoubleVariables.Select(x => x.Substring(0, x.Length - 9)).ToList();
+ }
+ }
+ }
+}
Index: /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/TimeSeriesPrognosisInstanceConsumerView.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/TimeSeriesPrognosisInstanceConsumerView.Designer.cs (revision 8885)
+++ /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/TimeSeriesPrognosisInstanceConsumerView.Designer.cs (revision 8885)
@@ -0,0 +1,53 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see .
+ */
+#endregion
+
+namespace HeuristicLab.Problems.Instances.DataAnalysis.Views {
+ partial class TimeSeriesPrognosisInstanceConsumerView {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing) {
+ if (disposing && (components != null)) {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Component Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent() {
+ components = new System.ComponentModel.Container();
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+ }
+
+ #endregion
+ }
+}
Index: /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/TimeSeriesPrognosisInstanceConsumerView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/TimeSeriesPrognosisInstanceConsumerView.cs (revision 8885)
+++ /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/TimeSeriesPrognosisInstanceConsumerView.cs (revision 8885)
@@ -0,0 +1,68 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see .
+ */
+#endregion
+
+using System;
+using System.IO;
+using System.Windows.Forms;
+using HeuristicLab.MainForm;
+using HeuristicLab.Problems.DataAnalysis;
+
+namespace HeuristicLab.Problems.Instances.DataAnalysis.Views {
+ [View("TimeSeriesPrognosis InstanceProvider View")]
+ [Content(typeof(IProblemInstanceConsumer), IsDefaultView = true)]
+ public partial class TimeSeriesPrognosisInstanceConsumerView : DataAnalysisInstanceConsumerView {
+ public new IProblemInstanceConsumer Content {
+ get { return (IProblemInstanceConsumer)base.Content; }
+ set { base.Content = value; }
+ }
+
+ public TimeSeriesPrognosisInstanceConsumerView() {
+ InitializeComponent();
+ }
+
+ protected override void importButton_Click(object sender, EventArgs e) {
+ var provider = SelectedProvider as TimeSeriesPrognosisInstanceProvider;
+ if (provider != null) {
+ TimeSeriesPrognosisImportTypeDialog importTypeDialog = new TimeSeriesPrognosisImportTypeDialog();
+ if (importTypeDialog.ShowDialog() == DialogResult.OK) {
+ ITimeSeriesPrognosisProblemData instance = null;
+ try {
+ instance = provider.ImportData(importTypeDialog.Path, importTypeDialog.ImportType, importTypeDialog.CSVFormat);
+ }
+ catch (IOException ex) {
+ ErrorWhileParsing(ex);
+ return;
+ }
+ try {
+ GenericConsumer.Load(instance);
+ }
+ catch (IOException ex) {
+ ErrorWhileLoading(ex, importTypeDialog.Path);
+ }
+ } else {
+ return;
+ }
+ } else {
+ base.importButton_Click(sender, e);
+ }
+ }
+ }
+}
Index: /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Classification/CSV/ClassifiactionCSVInstanceProvider.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Classification/CSV/ClassifiactionCSVInstanceProvider.cs (revision 8884)
+++ /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Classification/CSV/ClassifiactionCSVInstanceProvider.cs (revision 8885)
@@ -94,6 +94,9 @@
List values = csvFileParser.Values;
if (type.Shuffle) {
- values = Shuffle(values, csvFileParser.VariableNames.ToList().FindIndex(x => x.Equals(type.TargetVariable)),
- type.Training, out trainingPartEnd);
+ values = Shuffle(values);
+ if (type.UniformlyDistributeClasses) {
+ values = Shuffle(values, csvFileParser.VariableNames.ToList().FindIndex(x => x.Equals(type.TargetVariable)),
+ type.Training, out trainingPartEnd);
+ }
}
@@ -147,6 +150,4 @@
trainingPartEnd = training.First().Count;
- training = Shuffle(training);
- test = Shuffle(test);
for (int i = 0; i < training.Count; i++) {
for (int j = 0; j < test[i].Count; j++) {
Index: /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Classification/ClassificationImportType.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Classification/ClassificationImportType.cs (revision 8884)
+++ /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Classification/ClassificationImportType.cs (revision 8885)
@@ -23,4 +23,5 @@
public class ClassificationImportType : DataAnalysisImportType {
public string TargetVariable { get; set; }
+ public bool UniformlyDistributeClasses { get; set; }
}
}
Index: /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/HeuristicLab.Problems.Instances.DataAnalysis-3.3.csproj
===================================================================
--- /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/HeuristicLab.Problems.Instances.DataAnalysis-3.3.csproj (revision 8884)
+++ /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/HeuristicLab.Problems.Instances.DataAnalysis-3.3.csproj (revision 8885)
@@ -203,4 +203,5 @@
+
Index: /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/TableFileParser.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/TableFileParser.cs (revision 8884)
+++ /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/TableFileParser.cs (revision 8885)
@@ -83,6 +83,6 @@
DateTimeFormatInfo dateTimeFormatInfo;
char separator;
- DetermineFileFormat(new FileStream(fileName, FileMode.Open), out numberFormat, out dateTimeFormatInfo, out separator);
- Parse(new FileStream(fileName, FileMode.Open), numberFormat, dateTimeFormatInfo, separator);
+ DetermineFileFormat(new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite), out numberFormat, out dateTimeFormatInfo, out separator);
+ Parse(new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite), numberFormat, dateTimeFormatInfo, separator);
}
@@ -95,5 +95,5 @@
/// defines the separator
public void Parse(string fileName, NumberFormatInfo numberFormat, DateTimeFormatInfo dateTimeFormatInfo, char separator) {
- Parse(new FileStream(fileName, FileMode.Open), numberFormat, dateTimeFormatInfo, separator);
+ Parse(new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite), numberFormat, dateTimeFormatInfo, separator);
}
@@ -163,5 +163,5 @@
public static void DetermineFileFormat(string path, out NumberFormatInfo numberFormat, out DateTimeFormatInfo dateTimeFormatInfo, out char separator) {
- DetermineFileFormat(new FileStream(path, FileMode.Open), out numberFormat, out dateTimeFormatInfo, out separator);
+ DetermineFileFormat(new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite), out numberFormat, out dateTimeFormatInfo, out separator);
}
Index: /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/TimeSeries/CSV/TimeSeriesPrognosisCSVInstanceProvider.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/TimeSeries/CSV/TimeSeriesPrognosisCSVInstanceProvider.cs (revision 8884)
+++ /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/TimeSeries/CSV/TimeSeriesPrognosisCSVInstanceProvider.cs (revision 8885)
@@ -20,8 +20,12 @@
#endregion
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Problems.DataAnalysis;
-using System;
-using System.Collections.Generic;
-using HeuristicLab.Problems.DataAnalysis;
namespace HeuristicLab.Problems.Instances.DataAnalysis {
public class TimeSeriesPrognosisCSVInstanceProvider : TimeSeriesPrognosisInstanceProvider {
@@ -48,4 +52,63 @@
throw new NotImplementedException();
}
+
+ public override bool CanImportData { get { return true; } }
+
+ public override ITimeSeriesPrognosisProblemData ImportData(string path) {
+ TableFileParser csvFileParser = new TableFileParser();
+ csvFileParser.Parse(path);
+
+ Dataset dataset = new Dataset(csvFileParser.VariableNames, csvFileParser.Values);
+ string targetVar = csvFileParser.VariableNames.Last();
+
+ IEnumerable allowedInputVars = dataset.DoubleVariables.Where(x => !x.Equals(targetVar));
+
+ ITimeSeriesPrognosisProblemData timeSeriesPrognosisData = new TimeSeriesPrognosisProblemData(dataset, allowedInputVars, targetVar);
+
+ int trainingPartEnd = csvFileParser.Rows * 2 / 3;
+ timeSeriesPrognosisData.TrainingPartition.Start = 0;
+ timeSeriesPrognosisData.TrainingPartition.End = trainingPartEnd;
+ timeSeriesPrognosisData.TestPartition.Start = trainingPartEnd;
+ timeSeriesPrognosisData.TestPartition.End = csvFileParser.Rows;
+
+ int pos = path.LastIndexOf('\\');
+ if (pos < 0)
+ timeSeriesPrognosisData.Name = path;
+ else {
+ pos++;
+ timeSeriesPrognosisData.Name = path.Substring(pos, path.Length - pos);
+ }
+ return timeSeriesPrognosisData;
+ }
+
+ protected override ITimeSeriesPrognosisProblemData ImportData(string path, TimeSeriesPrognosisImportType type, TableFileParser csvFileParser) {
+ Dataset dataset = new Dataset(csvFileParser.VariableNames, csvFileParser.Values);
+
+ // turn of input variables that are constant in the training partition
+ var allowedInputVars = new List();
+ int trainingPartEnd = (csvFileParser.Rows * type.Training) / 100;
+ trainingPartEnd = trainingPartEnd > 0 ? trainingPartEnd : 1;
+ var trainingIndizes = Enumerable.Range(0, trainingPartEnd);
+ if (trainingIndizes.Count() >= 2) {
+ foreach (var variableName in dataset.DoubleVariables) {
+ if (dataset.GetDoubleValues(variableName, trainingIndizes).Range() > 0 &&
+ variableName != type.TargetVariable)
+ allowedInputVars.Add(variableName);
+ }
+ } else {
+ allowedInputVars.AddRange(dataset.DoubleVariables.Where(x => !x.Equals(type.TargetVariable)));
+ }
+
+ TimeSeriesPrognosisProblemData timeSeriesPrognosisData = new TimeSeriesPrognosisProblemData(dataset, allowedInputVars, type.TargetVariable);
+
+ timeSeriesPrognosisData.TrainingPartition.Start = 0;
+ timeSeriesPrognosisData.TrainingPartition.End = trainingPartEnd;
+ timeSeriesPrognosisData.TestPartition.Start = trainingPartEnd;
+ timeSeriesPrognosisData.TestPartition.End = csvFileParser.Rows;
+
+ timeSeriesPrognosisData.Name = Path.GetFileName(path);
+
+ return timeSeriesPrognosisData;
+ }
}
}
Index: /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/TimeSeries/TimeSeriesPrognosisImportType.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/TimeSeries/TimeSeriesPrognosisImportType.cs (revision 8885)
+++ /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/TimeSeries/TimeSeriesPrognosisImportType.cs (revision 8885)
@@ -0,0 +1,26 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see .
+ */
+#endregion;
+
+namespace HeuristicLab.Problems.Instances.DataAnalysis {
+ public class TimeSeriesPrognosisImportType : DataAnalysisImportType {
+ public string TargetVariable { get; set; }
+ }
+}
Index: /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/TimeSeries/TimeSeriesPrognosisInstanceProvider.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/TimeSeries/TimeSeriesPrognosisInstanceProvider.cs (revision 8884)
+++ /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/TimeSeries/TimeSeriesPrognosisInstanceProvider.cs (revision 8885)
@@ -20,75 +20,8 @@
#endregion
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Text;
using HeuristicLab.Problems.DataAnalysis;
namespace HeuristicLab.Problems.Instances.DataAnalysis {
- public abstract class TimeSeriesPrognosisInstanceProvider : IProblemInstanceProvider {
- public bool CanImportData { get { return true; } }
- public bool CanExportData { get { return true; } }
-
-
- public ITimeSeriesPrognosisProblemData ImportData(string path) {
- TableFileParser csvFileParser = new TableFileParser();
- csvFileParser.Parse(path);
-
- Dataset dataset = new Dataset(csvFileParser.VariableNames, csvFileParser.Values);
- string targetVar = csvFileParser.VariableNames.Last();
-
- IEnumerable allowedInputVars = dataset.DoubleVariables.Where(x => !x.Equals(targetVar));
-
- ITimeSeriesPrognosisProblemData regData = new TimeSeriesPrognosisProblemData(dataset, allowedInputVars, targetVar);
-
- int trainingPartEnd = csvFileParser.Rows * 2 / 3;
- regData.TrainingPartition.Start = 0;
- regData.TrainingPartition.End = trainingPartEnd;
- regData.TestPartition.Start = trainingPartEnd;
- regData.TestPartition.End = csvFileParser.Rows;
-
- int pos = path.LastIndexOf('\\');
- if (pos < 0)
- regData.Name = path;
- else {
- pos++;
- regData.Name = path.Substring(pos, path.Length - pos);
- }
- return regData;
- }
-
- public void ExportData(ITimeSeriesPrognosisProblemData instance, string path) {
- StringBuilder strBuilder = new StringBuilder();
-
- foreach (var variable in instance.InputVariables) {
- strBuilder.Append(variable + ";");
- }
- strBuilder.Remove(strBuilder.Length - 1, 1);
- strBuilder.AppendLine();
-
- Dataset dataset = instance.Dataset;
-
- for (int i = 0; i < dataset.Rows; i++) {
- for (int j = 0; j < dataset.Columns; j++) {
- strBuilder.Append(dataset.GetValue(i, j) + ";");
- }
- strBuilder.Remove(strBuilder.Length - 1, 1);
- strBuilder.AppendLine();
- }
-
- using (StreamWriter writer = new StreamWriter(path)) {
- writer.Write(strBuilder);
- }
- }
-
- public abstract IEnumerable GetDataDescriptors();
- public abstract ITimeSeriesPrognosisProblemData LoadData(IDataDescriptor descriptor);
-
- public abstract string Name { get; }
- public abstract string Description { get; }
- public abstract Uri WebLink { get; }
- public abstract string ReferencePublication { get; }
+ public abstract class TimeSeriesPrognosisInstanceProvider : DataAnalysisInstanceProvider {
}
}