Free cookie consent management tool by TermsFeed Policy Generator

Changeset 8715


Ignore:
Timestamp:
10/02/12 09:49:43 (12 years ago)
Author:
sforsten
Message:

#1942:

  • added csv import dialog for regression
  • improved existing dialog (tool tip, design, preview of dataset)
Location:
branches/DataAnalysisCSVImport
Files:
5 added
16 edited

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysisCSVImport/DataAnalysisCSVImport.sln

    r8701 r8715  
    1111EndProject
    1212Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.Instances.DataAnalysis-3.3", "HeuristicLab.Problems.Instances.DataAnalysis\3.3\HeuristicLab.Problems.Instances.DataAnalysis-3.3.csproj", "{94C7714E-29D4-4D6D-B213-2C18D627AB75}"
     13EndProject
     14Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.DataAnalysis-3.4", "HeuristicLab.Problems.DataAnalysis\3.4\HeuristicLab.Problems.DataAnalysis-3.4.csproj", "{DF87C13E-A889-46FF-8153-66DCAA8C5674}"
    1315EndProject
    1416Global
     
    4244    {94C7714E-29D4-4D6D-B213-2C18D627AB75}.Release|x86.ActiveCfg = Release|x86
    4345    {94C7714E-29D4-4D6D-B213-2C18D627AB75}.Release|x86.Build.0 = Release|x86
     46    {DF87C13E-A889-46FF-8153-66DCAA8C5674}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
     47    {DF87C13E-A889-46FF-8153-66DCAA8C5674}.Debug|Any CPU.Build.0 = Debug|Any CPU
     48    {DF87C13E-A889-46FF-8153-66DCAA8C5674}.Debug|x64.ActiveCfg = Debug|x64
     49    {DF87C13E-A889-46FF-8153-66DCAA8C5674}.Debug|x64.Build.0 = Debug|x64
     50    {DF87C13E-A889-46FF-8153-66DCAA8C5674}.Debug|x86.ActiveCfg = Debug|x86
     51    {DF87C13E-A889-46FF-8153-66DCAA8C5674}.Debug|x86.Build.0 = Debug|x86
     52    {DF87C13E-A889-46FF-8153-66DCAA8C5674}.Release|Any CPU.ActiveCfg = Release|Any CPU
     53    {DF87C13E-A889-46FF-8153-66DCAA8C5674}.Release|Any CPU.Build.0 = Release|Any CPU
     54    {DF87C13E-A889-46FF-8153-66DCAA8C5674}.Release|x64.ActiveCfg = Release|x64
     55    {DF87C13E-A889-46FF-8153-66DCAA8C5674}.Release|x64.Build.0 = Release|x64
     56    {DF87C13E-A889-46FF-8153-66DCAA8C5674}.Release|x86.ActiveCfg = Release|x86
     57    {DF87C13E-A889-46FF-8153-66DCAA8C5674}.Release|x86.Build.0 = Release|x86
    4458  EndGlobalSection
    4559  GlobalSection(SolutionProperties) = preSolution
  • branches/DataAnalysisCSVImport/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj

    r8664 r8715  
    4141    <DebugType>full</DebugType>
    4242    <Optimize>false</Optimize>
    43     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     43    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
    4444    <DefineConstants>DEBUG;TRACE</DefineConstants>
    4545    <ErrorReport>prompt</ErrorReport>
     
    5050    <DebugType>pdbonly</DebugType>
    5151    <Optimize>true</Optimize>
    52     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     52    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
    5353    <DefineConstants>TRACE</DefineConstants>
    5454    <ErrorReport>prompt</ErrorReport>
     
    5858  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
    5959    <DebugSymbols>true</DebugSymbols>
    60     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     60    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
    6161    <DefineConstants>DEBUG;TRACE</DefineConstants>
    6262    <DebugType>full</DebugType>
     
    6666  </PropertyGroup>
    6767  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
    68     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     68    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
    6969    <DefineConstants>TRACE</DefineConstants>
    7070    <Optimize>true</Optimize>
     
    7676  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    7777    <DebugSymbols>true</DebugSymbols>
    78     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     78    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
    7979    <DefineConstants>DEBUG;TRACE</DefineConstants>
    8080    <DebugType>full</DebugType>
     
    8484  </PropertyGroup>
    8585  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    86     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     86    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
    8787    <DefineConstants>TRACE</DefineConstants>
    8888    <Optimize>true</Optimize>
     
    9393  </PropertyGroup>
    9494  <ItemGroup>
    95     <Reference Include="ALGLIB-3.6.0, Version=3.6.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    96       <HintPath>..\..\bin\ALGLIB-3.6.0.dll</HintPath>
    97       <Private>False</Private>
    98     </Reference>
    99     <Reference Include="HeuristicLab.ALGLIB-3.6.0, Version=3.6.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    100       <HintPath>..\..\bin\HeuristicLab.ALGLIB-3.6.0.dll</HintPath>
     95    <Reference Include="ALGLIB-3.6.0">
     96      <HintPath>..\..\..\..\trunk\sources\bin\ALGLIB-3.6.0.dll</HintPath>
     97      <Private>False</Private>
     98    </Reference>
     99    <Reference Include="HeuristicLab.ALGLIB-3.6.0">
     100      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.ALGLIB-3.6.0.dll</HintPath>
     101      <Private>False</Private>
     102    </Reference>
     103    <Reference Include="HeuristicLab.Collections-3.3">
     104      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Collections-3.3.dll</HintPath>
     105      <Private>False</Private>
     106    </Reference>
     107    <Reference Include="HeuristicLab.Common-3.3">
     108      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath>
     109      <Private>False</Private>
     110    </Reference>
     111    <Reference Include="HeuristicLab.Common.Resources-3.3">
     112      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common.Resources-3.3.dll</HintPath>
     113      <Private>False</Private>
     114    </Reference>
     115    <Reference Include="HeuristicLab.Core-3.3">
     116      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath>
     117      <Private>False</Private>
     118    </Reference>
     119    <Reference Include="HeuristicLab.Data-3.3">
     120      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath>
     121      <Private>False</Private>
     122    </Reference>
     123    <Reference Include="HeuristicLab.Optimization-3.3">
     124      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
     125      <Private>False</Private>
     126    </Reference>
     127    <Reference Include="HeuristicLab.Parameters-3.3">
     128      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Parameters-3.3.dll</HintPath>
     129      <Private>False</Private>
     130    </Reference>
     131    <Reference Include="HeuristicLab.Persistence-3.3">
     132      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Persistence-3.3.dll</HintPath>
     133      <Private>False</Private>
     134    </Reference>
     135    <Reference Include="HeuristicLab.PluginInfrastructure-3.3">
     136      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
     137      <Private>False</Private>
     138    </Reference>
     139    <Reference Include="HeuristicLab.Problems.Instances-3.3">
     140      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.Instances-3.3.dll</HintPath>
    101141      <Private>False</Private>
    102142    </Reference>
     
    220260    </BootstrapperPackage>
    221261  </ItemGroup>
    222   <ItemGroup>
    223     <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj">
    224       <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project>
    225       <Name>HeuristicLab.Collections-3.3</Name>
    226       <Private>False</Private>
    227     </ProjectReference>
    228     <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj">
    229       <Project>{0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}</Project>
    230       <Name>HeuristicLab.Common.Resources-3.3</Name>
    231       <Private>False</Private>
    232     </ProjectReference>
    233     <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">
    234       <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project>
    235       <Name>HeuristicLab.Common-3.3</Name>
    236       <Private>False</Private>
    237     </ProjectReference>
    238     <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj">
    239       <Project>{C36BD924-A541-4A00-AFA8-41701378DDC5}</Project>
    240       <Name>HeuristicLab.Core-3.3</Name>
    241       <Private>False</Private>
    242     </ProjectReference>
    243     <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj">
    244       <Project>{BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}</Project>
    245       <Name>HeuristicLab.Data-3.3</Name>
    246       <Private>False</Private>
    247     </ProjectReference>
    248     <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj">
    249       <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project>
    250       <Name>HeuristicLab.Optimization-3.3</Name>
    251       <Private>False</Private>
    252     </ProjectReference>
    253     <ProjectReference Include="..\..\HeuristicLab.Parameters\3.3\HeuristicLab.Parameters-3.3.csproj">
    254       <Project>{56F9106A-079F-4C61-92F6-86A84C2D84B7}</Project>
    255       <Name>HeuristicLab.Parameters-3.3</Name>
    256       <Private>False</Private>
    257     </ProjectReference>
    258     <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj">
    259       <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project>
    260       <Name>HeuristicLab.Persistence-3.3</Name>
    261       <Private>False</Private>
    262     </ProjectReference>
    263     <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj">
    264       <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
    265       <Name>HeuristicLab.PluginInfrastructure-3.3</Name>
    266       <Private>False</Private>
    267     </ProjectReference>
    268     <ProjectReference Include="..\..\HeuristicLab.Problems.Instances\3.3\HeuristicLab.Problems.Instances-3.3.csproj">
    269       <Project>{3540E29E-4793-49E7-8EE2-FEA7F61C3994}</Project>
    270       <Name>HeuristicLab.Problems.Instances-3.3</Name>
    271       <Private>False</Private>
    272     </ProjectReference>
    273   </ItemGroup>
    274262  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    275263  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
  • branches/DataAnalysisCSVImport/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblemData.cs

    r8554 r8715  
    295295    }
    296296
    297     private static IEnumerable<string> CheckVariablesForPossibleTargetVariables(Dataset dataset) {
     297    public static IEnumerable<string> CheckVariablesForPossibleTargetVariables(Dataset dataset) {
    298298      int maxSamples = Math.Min(InspectedRowsToDetermineTargets, dataset.Rows);
    299299      var validTargetVariables = (from v in dataset.DoubleVariables
  • branches/DataAnalysisCSVImport/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/ClassificationImportTypeDialog.Designer.cs

    r8701 r8715  
    2525    private void InitializeComponent() {
    2626      this.TargetVariableComboBox = new System.Windows.Forms.ComboBox();
     27      this.TargetVariableLabel = new System.Windows.Forms.Label();
     28      this.TargetVariableInfoLabel = new System.Windows.Forms.Label();
    2729      ((System.ComponentModel.ISupportInitialize)(this.TrainingTestTrackBar)).BeginInit();
     30      this.CSVSettingsGroupBox.SuspendLayout();
     31      this.ProblemDataSettingsGroupBox.SuspendLayout();
    2832      this.SuspendLayout();
     33      //
     34      // ProblemDataSettingsGroupBox
     35      //
     36      this.ProblemDataSettingsGroupBox.Controls.Add(this.TargetVariableInfoLabel);
     37      this.ProblemDataSettingsGroupBox.Controls.Add(this.TargetVariableLabel);
     38      this.ProblemDataSettingsGroupBox.Controls.Add(this.TargetVariableComboBox);
     39      this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.PreviewLabel, 0);
     40      this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.ShuffelInfoLabel, 0);
     41      this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.TargetVariableComboBox, 0);
     42      this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.ShuffleDataCheckbox, 0);
     43      this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.TargetVariableLabel, 0);
     44      this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.TargetVariableInfoLabel, 0);
     45      this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.TrainingTestTrackBar, 0);
     46      this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.TrainingLabel, 0);
     47      this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.PreviewDatasetMatrix, 0);
     48      this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.TestLabel, 0);
     49      this.ProblemDataSettingsGroupBox.Controls.SetChildIndex(this.ErrorTextBox, 0);
    2950      //
    3051      // TargetVariableComboBox
    3152      //
     53      this.TargetVariableComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     54                  | System.Windows.Forms.AnchorStyles.Right)));
    3255      this.TargetVariableComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
    3356      this.TargetVariableComboBox.FormattingEnabled = true;
    34       this.TargetVariableComboBox.Location = new System.Drawing.Point(109, 38);
     57      this.TargetVariableComboBox.Location = new System.Drawing.Point(230, 19);
    3558      this.TargetVariableComboBox.Name = "TargetVariableComboBox";
    36       this.TargetVariableComboBox.Size = new System.Drawing.Size(121, 21);
     59      this.TargetVariableComboBox.Size = new System.Drawing.Size(181, 21);
    3760      this.TargetVariableComboBox.TabIndex = 10;
     61      //
     62      // TargetVariableLabel
     63      //
     64      this.TargetVariableLabel.AutoSize = true;
     65      this.TargetVariableLabel.Location = new System.Drawing.Point(142, 22);
     66      this.TargetVariableLabel.Name = "TargetVariableLabel";
     67      this.TargetVariableLabel.Size = new System.Drawing.Size(82, 13);
     68      this.TargetVariableLabel.TabIndex = 20;
     69      this.TargetVariableLabel.Text = "Target Variable:";
     70      //
     71      // TargetVariableinfoLabel
     72      //
     73      this.TargetVariableInfoLabel.Location = new System.Drawing.Point(421, 21);
     74      this.TargetVariableInfoLabel.Name = "Target Variable Info";
     75      this.TargetVariableInfoLabel.Size = new System.Drawing.Size(16, 16);
     76      this.TargetVariableInfoLabel.TabIndex = 21;
     77      this.TargetVariableInfoLabel.Tag = "Select the target variable of the csv file.";
     78      this.TargetVariableInfoLabel.Image = HeuristicLab.Common.Resources.VSImageLibrary.Information;
     79      this.TargetVariableInfoLabel.DoubleClick += new System.EventHandler(this.ControlToolTip_DoubleClick);
    3880      //
    3981      // ClassificationImportTypeDialog
     
    4183      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    4284      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    43       this.ClientSize = new System.Drawing.Size(339, 184);
    44       this.Controls.Add(this.TargetVariableComboBox);
     85      this.ClientSize = new System.Drawing.Size(471, 442);
    4586      this.Name = "ClassificationImportTypeDialog";
    4687      this.Text = "Classification CSV Import";
    47       this.Controls.SetChildIndex(this.TargetVariableComboBox, 0);
    48       this.Controls.SetChildIndex(this.ShuffleDataCheckbox, 0);
    49       this.Controls.SetChildIndex(this.OkButton, 0);
    50       this.Controls.SetChildIndex(this.CancelButton, 0);
    51       this.Controls.SetChildIndex(this.ProblemFileLabel, 0);
    52       this.Controls.SetChildIndex(this.OpenFileButton, 0);
    53       this.Controls.SetChildIndex(this.ProblemTextBox, 0);
    5488      ((System.ComponentModel.ISupportInitialize)(this.TrainingTestTrackBar)).EndInit();
     89      this.CSVSettingsGroupBox.ResumeLayout(false);
     90      this.CSVSettingsGroupBox.PerformLayout();
     91      this.ProblemDataSettingsGroupBox.ResumeLayout(false);
     92      this.ProblemDataSettingsGroupBox.PerformLayout();
    5593      this.ResumeLayout(false);
    5694      this.PerformLayout();
     
    6199
    62100    private System.Windows.Forms.ComboBox TargetVariableComboBox;
     101    private System.Windows.Forms.Label TargetVariableLabel;
     102    protected System.Windows.Forms.Label TargetVariableInfoLabel;
    63103
    64104
  • branches/DataAnalysisCSVImport/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/ClassificationImportTypeDialog.cs

    r8701 r8715  
    2020#endregion
    2121
     22using System;
     23using System.Collections.Generic;
     24using System.Linq;
     25using HeuristicLab.Problems.DataAnalysis;
     26
    2227namespace HeuristicLab.Problems.Instances.DataAnalysis.Views {
    2328
     
    2833          Shuffle = ShuffleDataCheckbox.Checked,
    2934          Training = TrainingTestTrackBar.Value,
     35          TargetVariable = (String)TargetVariableComboBox.SelectedValue
    3036        };
    3137      }
     
    3440    public ClassificationImportTypeDialog() {
    3541      InitializeComponent();
     42
     43      ToolTip.SetToolTip(TargetVariableInfoLabel, (string)TargetVariableInfoLabel.Tag);
     44    }
     45
     46    protected override void CheckAdditionalConstraints(TableFileParser csvParser) {
     47      base.CheckAdditionalConstraints(csvParser);
     48      SetPossibleTargetVariables();
     49    }
     50
     51    protected void SetPossibleTargetVariables() {
     52      var dataset = PreviewDatasetMatrix.Content as Dataset;
     53      if (dataset != null) {
     54        IEnumerable<string> possibleTargetVariables = ClassificationProblemData.CheckVariablesForPossibleTargetVariables(dataset);
     55
     56        // Remove " (Double)" at the end of the variable name (last 9 chars)
     57        TargetVariableComboBox.DataSource = possibleTargetVariables.Select(x => x.Substring(0, x.Length - 9)).ToList();
     58      }
    3659    }
    3760  }
  • branches/DataAnalysisCSVImport/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/DataAnalysisImportTypeDialog.Designer.cs

    r8701 r8715  
    11
    2 using HeuristicLab.Common.Resources;
    32namespace HeuristicLab.Problems.Instances.DataAnalysis.Views {
    43  partial class DataAnalysisImportTypeDialog {
     
    2625    /// </summary>
    2726    private void InitializeComponent() {
     27      this.components = new System.ComponentModel.Container();
     28      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DataAnalysisImportTypeDialog));
    2829      this.ShuffleDataCheckbox = new System.Windows.Forms.CheckBox();
    2930      this.OkButton = new System.Windows.Forms.Button();
     
    4344      this.SeparatorComboBox = new System.Windows.Forms.ComboBox();
    4445      this.CSVSettingsGroupBox = new System.Windows.Forms.GroupBox();
    45       this.SeparatorInfoButton = new System.Windows.Forms.Button();
     46      this.DateTimeFormatInfoLabel = new System.Windows.Forms.Label();
     47      this.DecimalSeparatorInfoLabel = new System.Windows.Forms.Label();
     48      this.SeparatorInfoLabel = new System.Windows.Forms.Label();
    4649      this.ProblemDataSettingsGroupBox = new System.Windows.Forms.GroupBox();
     50      this.ErrorTextBox = new System.Windows.Forms.TextBox();
     51      this.ShuffelInfoLabel = new System.Windows.Forms.Label();
    4752      this.PreviewLabel = new System.Windows.Forms.Label();
    48       this.ErrorTextBox = new System.Windows.Forms.TextBox();
    4953      this.PreviewDatasetMatrix = new HeuristicLab.Data.Views.StringConvertibleMatrixView();
    50       this.DecimalSeparatorInfoButton = new System.Windows.Forms.Button();
    51       this.DateTimeFormatInfoButton = new System.Windows.Forms.Button();
    52       this.ShuffleDataInfoButton = new System.Windows.Forms.Button();
     54      this.ToolTip = new System.Windows.Forms.ToolTip(this.components);
    5355      ((System.ComponentModel.ISupportInitialize)(this.TrainingTestTrackBar)).BeginInit();
    5456      this.CSVSettingsGroupBox.SuspendLayout();
     
    123125      this.CancelButton.UseVisualStyleBackColor = true;
    124126      //
    125       // openFileButton
     127      // OpenFileButton
    126128      //
    127129      this.OpenFileButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     130      this.OpenFileButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Open;
    128131      this.OpenFileButton.Location = new System.Drawing.Point(429, 3);
    129       this.OpenFileButton.Name = "openFileButton";
     132      this.OpenFileButton.Name = "OpenFileButton";
    130133      this.OpenFileButton.Size = new System.Drawing.Size(24, 24);
    131134      this.OpenFileButton.TabIndex = 8;
    132       this.OpenFileButton.Text = "Open";
    133135      this.OpenFileButton.UseVisualStyleBackColor = true;
    134       this.OpenFileButton.Click += new System.EventHandler(this.openFileButton_Click);
     136      this.OpenFileButton.Click += new System.EventHandler(this.OpenFileButtonClick);
    135137      //
    136138      // ProblemFileLabel
     
    224226      this.CSVSettingsGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    225227                  | System.Windows.Forms.AnchorStyles.Right)));
    226       this.CSVSettingsGroupBox.Controls.Add(this.DateTimeFormatInfoButton);
    227       this.CSVSettingsGroupBox.Controls.Add(this.DecimalSeparatorInfoButton);
    228       this.CSVSettingsGroupBox.Controls.Add(this.SeparatorInfoButton);
     228      this.CSVSettingsGroupBox.Controls.Add(this.DateTimeFormatInfoLabel);
     229      this.CSVSettingsGroupBox.Controls.Add(this.DecimalSeparatorInfoLabel);
     230      this.CSVSettingsGroupBox.Controls.Add(this.SeparatorInfoLabel);
    229231      this.CSVSettingsGroupBox.Controls.Add(this.SeparatorComboBox);
    230232      this.CSVSettingsGroupBox.Controls.Add(this.DateTimeFormatComboBox);
     
    240242      this.CSVSettingsGroupBox.Text = "CSV Settings";
    241243      //
    242       // SeparatorInfoButton
    243       //
    244       this.SeparatorInfoButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    245       this.SeparatorInfoButton.Location = new System.Drawing.Point(417, 17);
    246       this.SeparatorInfoButton.Name = "SeparatorInfoButton";
    247       this.SeparatorInfoButton.Size = new System.Drawing.Size(24, 24);
    248       this.SeparatorInfoButton.TabIndex = 18;
    249       this.SeparatorInfoButton.Text = "SeparatorInfo";
    250       this.SeparatorInfoButton.UseVisualStyleBackColor = true;
     244      // DateTimeFormatInfoLabel
     245      //
     246      this.DateTimeFormatInfoLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     247      this.DateTimeFormatInfoLabel.Location = new System.Drawing.Point(421, 76);
     248      this.DateTimeFormatInfoLabel.Name = "DateTime Format Info";
     249      this.DateTimeFormatInfoLabel.Size = new System.Drawing.Size(16, 16);
     250      this.DateTimeFormatInfoLabel.TabIndex = 23;
     251      this.DateTimeFormatInfoLabel.Tag = "Select the date time format used in the csv file";
     252      this.DateTimeFormatInfoLabel.Image = HeuristicLab.Common.Resources.VSImageLibrary.Information;
     253      this.DateTimeFormatInfoLabel.DoubleClick += new System.EventHandler(this.ControlToolTip_DoubleClick);
     254      //
     255      // DecimalSeparatorInfoLabel
     256      //
     257      this.DecimalSeparatorInfoLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     258      this.DecimalSeparatorInfoLabel.Location = new System.Drawing.Point(421, 49);
     259      this.DecimalSeparatorInfoLabel.Name = "Decimal Separator Info";
     260      this.DecimalSeparatorInfoLabel.Size = new System.Drawing.Size(16, 16);
     261      this.DecimalSeparatorInfoLabel.TabIndex = 22;
     262      this.DecimalSeparatorInfoLabel.Tag = "Select the decimal separator used to for double values";
     263      this.DecimalSeparatorInfoLabel.Image = HeuristicLab.Common.Resources.VSImageLibrary.Information;
     264      this.DecimalSeparatorInfoLabel.DoubleClick += new System.EventHandler(this.ControlToolTip_DoubleClick);
     265      //
     266      // SeparatorInfoLabel
     267      //
     268      this.SeparatorInfoLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     269      this.SeparatorInfoLabel.Location = new System.Drawing.Point(421, 22);
     270      this.SeparatorInfoLabel.Name = "Separator Info";
     271      this.SeparatorInfoLabel.Size = new System.Drawing.Size(16, 16);
     272      this.SeparatorInfoLabel.TabIndex = 21;
     273      this.SeparatorInfoLabel.Tag = "Select the separator used to separate columns in the csv file.";
     274      this.SeparatorInfoLabel.Image = HeuristicLab.Common.Resources.VSImageLibrary.Information;
     275      this.SeparatorInfoLabel.DoubleClick += new System.EventHandler(this.ControlToolTip_DoubleClick);
    251276      //
    252277      // ProblemDataSettingsGroupBox
     
    255280                  | System.Windows.Forms.AnchorStyles.Left)
    256281                  | System.Windows.Forms.AnchorStyles.Right)));
    257       this.ProblemDataSettingsGroupBox.Controls.Add(this.ShuffleDataInfoButton);
     282      this.ProblemDataSettingsGroupBox.Controls.Add(this.ErrorTextBox);
     283      this.ProblemDataSettingsGroupBox.Controls.Add(this.ShuffelInfoLabel);
    258284      this.ProblemDataSettingsGroupBox.Controls.Add(this.PreviewLabel);
    259       this.ProblemDataSettingsGroupBox.Controls.Add(this.ErrorTextBox);
    260285      this.ProblemDataSettingsGroupBox.Controls.Add(this.TestLabel);
    261286      this.ProblemDataSettingsGroupBox.Controls.Add(this.PreviewDatasetMatrix);
     
    270295      this.ProblemDataSettingsGroupBox.Text = "ProblemData Settings";
    271296      //
     297      // ErrorTextBox
     298      //
     299      this.ErrorTextBox.Location = new System.Drawing.Point(6, 15);
     300      this.ErrorTextBox.Multiline = true;
     301      this.ErrorTextBox.Name = "ErrorTextBox";
     302      this.ErrorTextBox.Size = new System.Drawing.Size(435, 73);
     303      this.ErrorTextBox.TabIndex = 0;
     304      this.ErrorTextBox.Visible = false;
     305      //
     306      // ShuffelInfoLabel
     307      //
     308      this.ShuffelInfoLabel.Location = new System.Drawing.Point(111, 20);
     309      this.ShuffelInfoLabel.Name = "Shuffle Info";
     310      this.ShuffelInfoLabel.Size = new System.Drawing.Size(16, 16);
     311      this.ShuffelInfoLabel.TabIndex = 8;
     312      this.ShuffelInfoLabel.Tag = "Check, if the importat data should be shuffled";
     313      this.ShuffelInfoLabel.Image = HeuristicLab.Common.Resources.VSImageLibrary.Information;
     314      this.ShuffelInfoLabel.DoubleClick += new System.EventHandler(this.ControlToolTip_DoubleClick);
     315      //
    272316      // PreviewLabel
    273317      //
     
    278322      this.PreviewLabel.TabIndex = 7;
    279323      this.PreviewLabel.Text = "Preview";
    280       //
    281       // ErrorTextBox
    282       //
    283       this.ErrorTextBox.Location = new System.Drawing.Point(111, 164);
    284       this.ErrorTextBox.Multiline = true;
    285       this.ErrorTextBox.Name = "ErrorTextBox";
    286       this.ErrorTextBox.Size = new System.Drawing.Size(193, 32);
    287       this.ErrorTextBox.TabIndex = 0;
    288       this.ErrorTextBox.Visible = false;
    289324      //
    290325      // PreviewDatasetMatrix
     
    302337      this.PreviewDatasetMatrix.Size = new System.Drawing.Size(435, 144);
    303338      this.PreviewDatasetMatrix.TabIndex = 0;
    304       //
    305       // DecimalSeparatorInfoButtin
    306       //
    307       this.DecimalSeparatorInfoButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    308       this.DecimalSeparatorInfoButton.Location = new System.Drawing.Point(417, 44);
    309       this.DecimalSeparatorInfoButton.Name = "DecimalSeparatorInfoButtin";
    310       this.DecimalSeparatorInfoButton.Size = new System.Drawing.Size(24, 24);
    311       this.DecimalSeparatorInfoButton.TabIndex = 19;
    312       this.DecimalSeparatorInfoButton.Text = "DecimalSeparatorInfo";
    313       this.DecimalSeparatorInfoButton.UseVisualStyleBackColor = true;
    314       //
    315       // DateTimeFormatInfoButton
    316       //
    317       this.DateTimeFormatInfoButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    318       this.DateTimeFormatInfoButton.Location = new System.Drawing.Point(417, 71);
    319       this.DateTimeFormatInfoButton.Name = "DateTimeFormatInfoButton";
    320       this.DateTimeFormatInfoButton.Size = new System.Drawing.Size(24, 24);
    321       this.DateTimeFormatInfoButton.TabIndex = 20;
    322       this.DateTimeFormatInfoButton.Text = "DateTimeFormatInfo";
    323       this.DateTimeFormatInfoButton.UseVisualStyleBackColor = true;
    324       //
    325       // ShuffleDataInfoButton
    326       //
    327       this.ShuffleDataInfoButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    328       this.ShuffleDataInfoButton.Location = new System.Drawing.Point(111, 15);
    329       this.ShuffleDataInfoButton.Name = "ShuffleDataInfoButton";
    330       this.ShuffleDataInfoButton.Size = new System.Drawing.Size(24, 24);
    331       this.ShuffleDataInfoButton.TabIndex = 19;
    332       this.ShuffleDataInfoButton.Text = "ShuffleDataInfo";
    333       this.ShuffleDataInfoButton.UseVisualStyleBackColor = true;
    334339      //
    335340      // DataAnalysisImportTypeDialog
     
    385390    protected System.Windows.Forms.TextBox ErrorTextBox;
    386391    protected HeuristicLab.Data.Views.StringConvertibleMatrixView PreviewDatasetMatrix;
    387     private System.Windows.Forms.Label PreviewLabel;
    388     protected System.Windows.Forms.Button SeparatorInfoButton;
    389     protected System.Windows.Forms.Button DateTimeFormatInfoButton;
    390     protected System.Windows.Forms.Button DecimalSeparatorInfoButton;
    391     protected System.Windows.Forms.Button ShuffleDataInfoButton;
    392 
     392    protected System.Windows.Forms.Label PreviewLabel;
     393    protected System.Windows.Forms.Label SeparatorInfoLabel;
     394    protected System.Windows.Forms.Label DateTimeFormatInfoLabel;
     395    protected System.Windows.Forms.Label DecimalSeparatorInfoLabel;
     396    protected System.Windows.Forms.Label ShuffelInfoLabel;
     397    protected System.Windows.Forms.ToolTip ToolTip;
    393398  }
    394399}
  • branches/DataAnalysisCSVImport/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/DataAnalysisImportTypeDialog.cs

    r8701 r8715  
    2626using System.Linq;
    2727using System.Windows.Forms;
    28 using HeuristicLab.Common.Resources;
     28using HeuristicLab.Core.Views;
    2929using HeuristicLab.Problems.DataAnalysis;
    3030
     
    7575    public DataAnalysisImportTypeDialog() {
    7676      InitializeComponent();
    77       OpenFileButton.Text = String.Empty;
    78       OpenFileButton.Image = VSImageLibrary.Open;
    79       SeparatorInfoButton.Text = String.Empty;
    80       SeparatorInfoButton.Image = VSImageLibrary.Information;
    81       DecimalSeparatorInfoButton.Text = String.Empty;
    82       DecimalSeparatorInfoButton.Image = VSImageLibrary.Information;
    83       DateTimeFormatInfoButton.Text = String.Empty;
    84       DateTimeFormatInfoButton.Image = VSImageLibrary.Information;
    85       ShuffleDataInfoButton.Text = String.Empty;
    86       ShuffleDataInfoButton.Image = VSImageLibrary.Information;
     77      ToolTip.SetToolTip(SeparatorInfoLabel, (string)SeparatorInfoLabel.Tag);
     78      ToolTip.SetToolTip(DecimalSeparatorInfoLabel, (string)DecimalSeparatorInfoLabel.Tag);
     79      ToolTip.SetToolTip(DateTimeFormatInfoLabel, (string)DateTimeFormatInfoLabel.Tag);
     80      ToolTip.SetToolTip(ShuffelInfoLabel, (string)ShuffelInfoLabel.Tag);
    8781
    8882      SeparatorComboBox.DataSource = POSSIBLE_SEPARATORS;
     
    10296    }
    10397
    104     private void openFileButton_Click(object sender, System.EventArgs e) {
     98    protected virtual void OpenFileButtonClick(object sender, System.EventArgs e) {
    10599      if (openFileDialog.ShowDialog(this) == DialogResult.OK) {
    106100        ProblemTextBox.Text = openFileDialog.FileName;
     
    109103    }
    110104
    111     protected void CSVFormatComboBoxSelectionChangeCommitted(object sender, EventArgs e) {
     105    protected virtual void CSVFormatComboBoxSelectionChangeCommitted(object sender, EventArgs e) {
    112106      if (!ProblemTextBox.Text.Equals(String.Empty)) {
    113107        ParseCSVFile();
     
    123117                        (DateTimeFormatInfo)DateTimeFormatComboBox.SelectedValue,
    124118                        (char)SeparatorComboBox.SelectedValue);
    125         OkButton.Enabled = true;
    126119        IEnumerable<string> variableNamesWithType = GetVariableNamesWithType(csvParser);
    127120        PreviewDatasetMatrix.Content = new Dataset(variableNamesWithType, csvParser.Values);
    128         var bla = new Dataset(csvParser.VariableNames, csvParser.Values);
    129121
    130         if (!csvParser.Values.Any(x => x is List<double>)) {
    131           throw new ArgumentException("No double column could be found!");
    132         }
     122        CheckAdditionalConstraints(csvParser);
     123
    133124        ErrorTextBox.Text = String.Empty;
    134125        ErrorTextBox.Visible = false;
     126        OkButton.Enabled = true;
    135127      }
    136128      catch (Exception ex) {
     
    138130        ErrorTextBox.Text = ex.Message;
    139131        ErrorTextBox.Visible = true;
     132      }
     133    }
     134
     135    protected virtual void CheckAdditionalConstraints(TableFileParser csvParser) {
     136      if (!csvParser.Values.Any(x => x is List<double>)) {
     137        throw new ArgumentException("No double column could be found!");
    140138      }
    141139    }
     
    156154      return variableNamesWithType;
    157155    }
     156
     157    protected void ControlToolTip_DoubleClick(object sender, EventArgs e) {
     158      Control control = sender as Control;
     159      if (control != null) {
     160        using (TextDialog dialog = new TextDialog(control.Name, (string)control.Tag, true)) {
     161          dialog.ShowDialog(this);
     162        }
     163      }
     164    }
    158165  }
    159166}
  • branches/DataAnalysisCSVImport/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/DataAnalysisInstanceConsumerView.cs

    r8701 r8715  
    3030  [View("DataAnalysis InstanceProvider View")]
    3131  [Content(typeof(IProblemInstanceConsumer<IDataAnalysisProblemData>), IsDefaultView = true)]
    32   [Content(typeof(IProblemInstanceConsumer<IRegressionProblemData>), IsDefaultView = true)]
    3332  [Content(typeof(IProblemInstanceConsumer<IClusteringProblemData>), IsDefaultView = true)]
    3433  public partial class DataAnalysisInstanceConsumerView<T> : ProblemInstanceConsumerViewGeneric<T>
  • branches/DataAnalysisCSVImport/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/HeuristicLab.Problems.Instances.DataAnalysis.Views-3.3.csproj

    r8701 r8715  
    3838  </PropertyGroup>
    3939  <ItemGroup>
    40     <Reference Include="HeuristicLab.Common-3.3">
    41       <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath>
     40    <Reference Include="HeuristicLab.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     41      <Private>False</Private>
    4242    </Reference>
    4343    <Reference Include="HeuristicLab.Common.Resources-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    4444      <Private>False</Private>
    4545    </Reference>
    46     <Reference Include="HeuristicLab.Core-3.3">
    47       <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath>
     46    <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     47      <Private>False</Private>
     48    </Reference>
     49    <Reference Include="HeuristicLab.Core.Views-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     50      <Private>False</Private>
    4851    </Reference>
    4952    <Reference Include="HeuristicLab.Data-3.3">
    5053      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath>
     54      <Private>False</Private>
    5155    </Reference>
    5256    <Reference Include="HeuristicLab.Data.Views-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     
    5559    <Reference Include="HeuristicLab.MainForm-3.3">
    5660      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.MainForm-3.3.dll</HintPath>
     61      <Private>False</Private>
    5762    </Reference>
    5863    <Reference Include="HeuristicLab.MainForm.WindowsForms-3.3">
    5964      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.MainForm.WindowsForms-3.3.dll</HintPath>
     65      <Private>False</Private>
    6066    </Reference>
    6167    <Reference Include="HeuristicLab.PluginInfrastructure-3.3">
    6268      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
    63     </Reference>
    64     <Reference Include="HeuristicLab.Problems.DataAnalysis-3.4">
    65       <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.DataAnalysis-3.4.dll</HintPath>
     69      <Private>False</Private>
    6670    </Reference>
    6771    <Reference Include="HeuristicLab.Problems.Instances-3.3">
    6872      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.Instances-3.3.dll</HintPath>
     73      <Private>False</Private>
    6974    </Reference>
    7075    <Reference Include="HeuristicLab.Problems.Instances.Views-3.3">
    7176      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.Instances.Views-3.3.dll</HintPath>
     77      <Private>False</Private>
    7278    </Reference>
    7379    <Reference Include="System">
    74       <Private>True</Private>
     80      <Private>False</Private>
    7581    </Reference>
    7682    <Reference Include="System.Core">
    77       <Private>True</Private>
     83      <Private>False</Private>
    7884    </Reference>
    7985    <Reference Include="System.Drawing">
    80       <Private>True</Private>
     86      <Private>False</Private>
    8187    </Reference>
    8288    <Reference Include="System.Windows.Forms">
    83       <Private>True</Private>
     89      <Private>False</Private>
    8490    </Reference>
    8591    <Reference Include="System.Xml.Linq">
    86       <Private>True</Private>
     92      <Private>False</Private>
    8793    </Reference>
    8894    <Reference Include="System.Data.DataSetExtensions">
    89       <Private>True</Private>
     95      <Private>False</Private>
    9096    </Reference>
    9197    <Reference Include="Microsoft.CSharp">
    92       <Private>True</Private>
     98      <Private>False</Private>
    9399    </Reference>
    94100    <Reference Include="System.Data">
    95       <Private>True</Private>
     101      <Private>False</Private>
    96102    </Reference>
    97103    <Reference Include="System.Xml">
    98       <Private>True</Private>
     104      <Private>False</Private>
    99105    </Reference>
    100106  </ItemGroup>
     
    111117    <Compile Include="ClassificationInstanceConsumerView.Designer.cs">
    112118      <DependentUpon>ClassificationInstanceConsumerView.cs</DependentUpon>
     119    </Compile>
     120    <Compile Include="RegressionImportTypeDialog.cs">
     121      <SubType>Form</SubType>
     122    </Compile>
     123    <Compile Include="RegressionImportTypeDialog.Designer.cs">
     124      <DependentUpon>RegressionImportTypeDialog.cs</DependentUpon>
     125    </Compile>
     126    <Compile Include="RegressionInstanceConsumerView.cs">
     127      <SubType>UserControl</SubType>
     128    </Compile>
     129    <Compile Include="RegressionInstanceConsumerView.Designer.cs">
     130      <DependentUpon>RegressionInstanceConsumerView.cs</DependentUpon>
    113131    </Compile>
    114132    <Compile Include="DataAnalysisImportTypeDialog.cs">
     
    131149  </ItemGroup>
    132150  <ItemGroup>
     151    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis\3.4\HeuristicLab.Problems.DataAnalysis-3.4.csproj">
     152      <Project>{DF87C13E-A889-46FF-8153-66DCAA8C5674}</Project>
     153      <Name>HeuristicLab.Problems.DataAnalysis-3.4</Name>
     154      <Private>False</Private>
     155    </ProjectReference>
    133156    <ProjectReference Include="..\..\HeuristicLab.Problems.Instances.DataAnalysis\3.3\HeuristicLab.Problems.Instances.DataAnalysis-3.3.csproj">
    134157      <Project>{94C7714E-29D4-4D6D-B213-2C18D627AB75}</Project>
  • branches/DataAnalysisCSVImport/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/Plugin.cs.frame

    r8598 r8715  
    2525  [Plugin("HeuristicLab.Problems.Instances.DataAnalysis.Views", "3.3.7.$WCREV$")]
    2626  [PluginFile("HeuristicLab.Problems.Instances.DataAnalysis.Views-3.3.dll", PluginFileType.Assembly)]
     27  [PluginDependency("HeuristicLab.Common.Resources", "3.3")]
     28  [PluginDependency("HeuristicLab.Core.Views", "3.3")]
     29  [PluginDependency("HeuristicLab.Data", "3.3")]
     30  [PluginDependency("HeuristicLab.Data.Views", "3.3")]
    2731  [PluginDependency("HeuristicLab.MainForm", "3.3")]
     32  [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")]
    2833  [PluginDependency("HeuristicLab.Problems.DataAnalysis", "3.4")]
    2934  [PluginDependency("HeuristicLab.Problems.Instances", "3.3")]
  • branches/DataAnalysisCSVImport/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Classification/CSV/ClassifiactionCSVInstanceProvider.cs

    r8701 r8715  
    7676        }
    7777      } else {
    78         allowedInputVars.AddRange(dataset.DoubleVariables.Where(x => x.Equals(targetVar)));
     78        allowedInputVars.AddRange(dataset.DoubleVariables.Where(x => !x.Equals(targetVar)));
    7979      }
    8080
     
    9696      List<IList> values = csvFileParser.Values;
    9797      if (type.Shuffle) {
    98         values = Shuffle(values);
     98        values = Shuffle(values, csvFileParser.VariableNames.ToList().FindIndex(x => x.Equals(type.TargetVariable)),
     99                         type.Training, out trainingPartEnd);
    99100      }
    100101
    101102      Dataset dataset = new Dataset(csvFileParser.VariableNames, values);
    102       string targetVar = dataset.DoubleVariables.Last();
    103103
    104104      // turn of input variables that are constant in the training partition
    105105      var allowedInputVars = new List<string>();
    106106      var trainingIndizes = Enumerable.Range(0, trainingPartEnd);
    107       foreach (var variableName in dataset.DoubleVariables) {
    108         if (trainingIndizes.Count() >= 2 && dataset.GetDoubleValues(variableName, trainingIndizes).Range() > 0 &&
    109           variableName != targetVar)
    110           allowedInputVars.Add(variableName);
    111       }
    112 
    113       ClassificationProblemData classificationData = new ClassificationProblemData(dataset, allowedInputVars, targetVar);
     107      if (trainingIndizes.Count() >= 2) {
     108        foreach (var variableName in dataset.DoubleVariables) {
     109          if (dataset.GetDoubleValues(variableName, trainingIndizes).Range() > 0 &&
     110            variableName != type.TargetVariable)
     111            allowedInputVars.Add(variableName);
     112        }
     113      } else {
     114        allowedInputVars.AddRange(dataset.DoubleVariables.Where(x => !x.Equals(type.TargetVariable)));
     115      }
     116
     117      ClassificationProblemData classificationData = new ClassificationProblemData(dataset, allowedInputVars, type.TargetVariable);
    114118
    115119      classificationData.TrainingPartition.Start = 0;
     
    123127    }
    124128
    125     protected List<IList> Shuffle(List<IList> values, int target, int trainingPercentage, int trainingPartEnd) {
    126       target = 5;
     129    protected List<IList> Shuffle(List<IList> values, int target, int trainingPercentage, out int trainingPartEnd) {
    127130      IList targetValues = values[target];
    128131      var group = targetValues.Cast<double>().GroupBy(x => x).Select(g => new { Key = g.Key, Count = g.Count() }).ToList();
    129132      Dictionary<double, double> taken = new Dictionary<double, double>();
    130133      foreach (var classCount in group) {
    131         taken[classCount.Key] = (classCount.Count * trainingPercentage) / 100;
     134        taken[classCount.Key] = (classCount.Count * trainingPercentage) / 100.0;
    132135      }
    133136
     
    143146        }
    144147      }
     148
     149      trainingPartEnd = training.First().Count;
    145150
    146151      training = Shuffle(training);
  • branches/DataAnalysisCSVImport/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Classification/ClassificationImportType.cs

    r8701 r8715  
    2222namespace HeuristicLab.Problems.Instances.DataAnalysis {
    2323  public class ClassificationImportType : DataAnalysisImportType {
    24     public string Variable { get; set; }
     24    public string TargetVariable { get; set; }
    2525  }
    2626}
  • branches/DataAnalysisCSVImport/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Clustering/CSV/ClusteringCSVInstanceProvider.cs

    r8701 r8715  
    7575        }
    7676      } else {
    77         allowedInputVars.AddRange(dataset.DoubleVariables.Where(x => x.Equals(targetVar)));
     77        allowedInputVars.AddRange(dataset.DoubleVariables.Where(x => !x.Equals(targetVar)));
    7878      }
    7979
     
    104104      int trainingPartEnd = (csvFileParser.Rows * type.Training) / 100;
    105105      var trainingIndizes = Enumerable.Range(0, trainingPartEnd);
    106       foreach (var variableName in dataset.DoubleVariables) {
    107         if (trainingIndizes.Count() >= 2 && dataset.GetDoubleValues(variableName, trainingIndizes).Range() > 0 &&
    108           variableName != targetVar)
    109           allowedInputVars.Add(variableName);
     106      if (trainingIndizes.Count() >= 2) {
     107        foreach (var variableName in dataset.DoubleVariables) {
     108          if (dataset.GetDoubleValues(variableName, trainingIndizes).Range() > 0 &&
     109            variableName != targetVar)
     110            allowedInputVars.Add(variableName);
     111        }
     112      } else {
     113        allowedInputVars.AddRange(dataset.DoubleVariables.Where(x => !x.Equals(targetVar)));
    110114      }
    111115
  • branches/DataAnalysisCSVImport/HeuristicLab.Problems.Instances.DataAnalysis/3.3/HeuristicLab.Problems.Instances.DataAnalysis-3.3.csproj

    r8701 r8715  
    9898  </PropertyGroup>
    9999  <ItemGroup>
    100     <Reference Include="HeuristicLab.Collections-3.3">
    101       <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Collections-3.3.dll</HintPath>
    102       <Private>False</Private>
    103     </Reference>
    104     <Reference Include="HeuristicLab.Common-3.3">
    105       <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath>
    106       <Private>False</Private>
    107     </Reference>
    108     <Reference Include="HeuristicLab.Core-3.3">
    109       <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath>
     100    <Reference Include="HeuristicLab.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     101      <Private>False</Private>
     102    </Reference>
     103    <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    110104      <Private>False</Private>
    111105    </Reference>
     
    164158    <Compile Include="Regression\ArtificialRegressionDataDescriptor.cs" />
    165159    <Compile Include="Regression\ArtificialRegressionInstanceProvider.cs" />
     160    <Compile Include="Regression\RegressionImportType.cs" />
    166161    <Compile Include="Regression\CSV\RegressionCSVInstanceProvider.cs" />
    167162    <Compile Include="Regression\Keijzer\KeijzerFunctionFourteen.cs" />
  • branches/DataAnalysisCSVImport/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/CSV/RegressionCSVInstanceProvider.cs

    r8701 r8715  
    6767      var allowedInputVars = new List<string>();
    6868      var trainingIndizes = Enumerable.Range(0, (csvFileParser.Rows * 2) / 3);
    69       foreach (var variableName in dataset.DoubleVariables) {
    70         if (trainingIndizes.Count() >= 2 && dataset.GetDoubleValues(variableName, trainingIndizes).Range() > 0 &&
    71           variableName != targetVar)
    72           allowedInputVars.Add(variableName);
     69      if (trainingIndizes.Count() >= 2) {
     70        foreach (var variableName in dataset.DoubleVariables) {
     71          if (dataset.GetDoubleValues(variableName, trainingIndizes).Range() > 0 &&
     72            variableName != targetVar)
     73            allowedInputVars.Add(variableName);
     74        }
     75      } else {
     76        allowedInputVars.AddRange(dataset.DoubleVariables.Where(x => !x.Equals(targetVar)));
    7377      }
    7478
     
    8690    }
    8791
    88     protected override IRegressionProblemData ImportData(string path, DataAnalysisImportType type, TableFileParser csvFileParser) {
     92    protected override IRegressionProblemData ImportData(string path, RegressionImportType type, TableFileParser csvFileParser) {
    8993      List<IList> values = csvFileParser.Values;
    9094      if (type.Shuffle) {
     
    9296      }
    9397      Dataset dataset = new Dataset(csvFileParser.VariableNames, values);
    94       string targetVar = dataset.DoubleVariables.Last();
    9598
    9699      // turn of input variables that are constant in the training partition
     
    102105        foreach (var variableName in dataset.DoubleVariables) {
    103106          if (dataset.GetDoubleValues(variableName, trainingIndizes).Range() > 0 &&
    104             variableName != targetVar)
     107            variableName != type.TargetVariable)
    105108            allowedInputVars.Add(variableName);
    106109        }
    107110      } else {
    108         allowedInputVars.AddRange(dataset.DoubleVariables.Where(x => x.Equals(targetVar)));
     111        allowedInputVars.AddRange(dataset.DoubleVariables.Where(x => !x.Equals(type.TargetVariable)));
    109112      }
    110113
    111       RegressionProblemData regressionData = new RegressionProblemData(dataset, allowedInputVars, targetVar);
     114      RegressionProblemData regressionData = new RegressionProblemData(dataset, allowedInputVars, type.TargetVariable);
    112115
    113116      regressionData.TrainingPartition.Start = 0;
  • branches/DataAnalysisCSVImport/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/RegressionInstanceProvider.cs

    r8701 r8715  
    2323
    2424namespace HeuristicLab.Problems.Instances.DataAnalysis {
    25   public abstract class RegressionInstanceProvider : DataAnalysisInstanceProvider<IRegressionProblemData, DataAnalysisImportType> {
     25  public abstract class RegressionInstanceProvider : DataAnalysisInstanceProvider<IRegressionProblemData, RegressionImportType> {
    2626  }
    2727}
Note: See TracChangeset for help on using the changeset viewer.