Changeset 8715
- Timestamp:
- 10/02/12 09:49:43 (12 years ago)
- Location:
- branches/DataAnalysisCSVImport
- Files:
-
- 5 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysisCSVImport/DataAnalysisCSVImport.sln
r8701 r8715 11 11 EndProject 12 12 Project("{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}" 13 EndProject 14 Project("{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}" 13 15 EndProject 14 16 Global … … 42 44 {94C7714E-29D4-4D6D-B213-2C18D627AB75}.Release|x86.ActiveCfg = Release|x86 43 45 {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 44 58 EndGlobalSection 45 59 GlobalSection(SolutionProperties) = preSolution -
branches/DataAnalysisCSVImport/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj
r8664 r8715 41 41 <DebugType>full</DebugType> 42 42 <Optimize>false</Optimize> 43 <OutputPath> $(SolutionDir)\bin\</OutputPath>43 <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath> 44 44 <DefineConstants>DEBUG;TRACE</DefineConstants> 45 45 <ErrorReport>prompt</ErrorReport> … … 50 50 <DebugType>pdbonly</DebugType> 51 51 <Optimize>true</Optimize> 52 <OutputPath> $(SolutionDir)\bin\</OutputPath>52 <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath> 53 53 <DefineConstants>TRACE</DefineConstants> 54 54 <ErrorReport>prompt</ErrorReport> … … 58 58 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> 59 59 <DebugSymbols>true</DebugSymbols> 60 <OutputPath> $(SolutionDir)\bin\</OutputPath>60 <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath> 61 61 <DefineConstants>DEBUG;TRACE</DefineConstants> 62 62 <DebugType>full</DebugType> … … 66 66 </PropertyGroup> 67 67 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' "> 68 <OutputPath> $(SolutionDir)\bin\</OutputPath>68 <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath> 69 69 <DefineConstants>TRACE</DefineConstants> 70 70 <Optimize>true</Optimize> … … 76 76 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> 77 77 <DebugSymbols>true</DebugSymbols> 78 <OutputPath> $(SolutionDir)\bin\</OutputPath>78 <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath> 79 79 <DefineConstants>DEBUG;TRACE</DefineConstants> 80 80 <DebugType>full</DebugType> … … 84 84 </PropertyGroup> 85 85 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> 86 <OutputPath> $(SolutionDir)\bin\</OutputPath>86 <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath> 87 87 <DefineConstants>TRACE</DefineConstants> 88 88 <Optimize>true</Optimize> … … 93 93 </PropertyGroup> 94 94 <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> 101 141 <Private>False</Private> 102 142 </Reference> … … 220 260 </BootstrapperPackage> 221 261 </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>274 262 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 275 263 <!-- 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 295 295 } 296 296 297 p rivatestatic IEnumerable<string> CheckVariablesForPossibleTargetVariables(Dataset dataset) {297 public static IEnumerable<string> CheckVariablesForPossibleTargetVariables(Dataset dataset) { 298 298 int maxSamples = Math.Min(InspectedRowsToDetermineTargets, dataset.Rows); 299 299 var validTargetVariables = (from v in dataset.DoubleVariables -
branches/DataAnalysisCSVImport/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/ClassificationImportTypeDialog.Designer.cs
r8701 r8715 25 25 private void InitializeComponent() { 26 26 this.TargetVariableComboBox = new System.Windows.Forms.ComboBox(); 27 this.TargetVariableLabel = new System.Windows.Forms.Label(); 28 this.TargetVariableInfoLabel = new System.Windows.Forms.Label(); 27 29 ((System.ComponentModel.ISupportInitialize)(this.TrainingTestTrackBar)).BeginInit(); 30 this.CSVSettingsGroupBox.SuspendLayout(); 31 this.ProblemDataSettingsGroupBox.SuspendLayout(); 28 32 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); 29 50 // 30 51 // TargetVariableComboBox 31 52 // 53 this.TargetVariableComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 54 | System.Windows.Forms.AnchorStyles.Right))); 32 55 this.TargetVariableComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 33 56 this.TargetVariableComboBox.FormattingEnabled = true; 34 this.TargetVariableComboBox.Location = new System.Drawing.Point( 109, 38);57 this.TargetVariableComboBox.Location = new System.Drawing.Point(230, 19); 35 58 this.TargetVariableComboBox.Name = "TargetVariableComboBox"; 36 this.TargetVariableComboBox.Size = new System.Drawing.Size(1 21, 21);59 this.TargetVariableComboBox.Size = new System.Drawing.Size(181, 21); 37 60 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); 38 80 // 39 81 // ClassificationImportTypeDialog … … 41 83 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 42 84 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); 45 86 this.Name = "ClassificationImportTypeDialog"; 46 87 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);54 88 ((System.ComponentModel.ISupportInitialize)(this.TrainingTestTrackBar)).EndInit(); 89 this.CSVSettingsGroupBox.ResumeLayout(false); 90 this.CSVSettingsGroupBox.PerformLayout(); 91 this.ProblemDataSettingsGroupBox.ResumeLayout(false); 92 this.ProblemDataSettingsGroupBox.PerformLayout(); 55 93 this.ResumeLayout(false); 56 94 this.PerformLayout(); … … 61 99 62 100 private System.Windows.Forms.ComboBox TargetVariableComboBox; 101 private System.Windows.Forms.Label TargetVariableLabel; 102 protected System.Windows.Forms.Label TargetVariableInfoLabel; 63 103 64 104 -
branches/DataAnalysisCSVImport/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/ClassificationImportTypeDialog.cs
r8701 r8715 20 20 #endregion 21 21 22 using System; 23 using System.Collections.Generic; 24 using System.Linq; 25 using HeuristicLab.Problems.DataAnalysis; 26 22 27 namespace HeuristicLab.Problems.Instances.DataAnalysis.Views { 23 28 … … 28 33 Shuffle = ShuffleDataCheckbox.Checked, 29 34 Training = TrainingTestTrackBar.Value, 35 TargetVariable = (String)TargetVariableComboBox.SelectedValue 30 36 }; 31 37 } … … 34 40 public ClassificationImportTypeDialog() { 35 41 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 } 36 59 } 37 60 } -
branches/DataAnalysisCSVImport/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/DataAnalysisImportTypeDialog.Designer.cs
r8701 r8715 1 1 2 using HeuristicLab.Common.Resources;3 2 namespace HeuristicLab.Problems.Instances.DataAnalysis.Views { 4 3 partial class DataAnalysisImportTypeDialog { … … 26 25 /// </summary> 27 26 private void InitializeComponent() { 27 this.components = new System.ComponentModel.Container(); 28 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DataAnalysisImportTypeDialog)); 28 29 this.ShuffleDataCheckbox = new System.Windows.Forms.CheckBox(); 29 30 this.OkButton = new System.Windows.Forms.Button(); … … 43 44 this.SeparatorComboBox = new System.Windows.Forms.ComboBox(); 44 45 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(); 46 49 this.ProblemDataSettingsGroupBox = new System.Windows.Forms.GroupBox(); 50 this.ErrorTextBox = new System.Windows.Forms.TextBox(); 51 this.ShuffelInfoLabel = new System.Windows.Forms.Label(); 47 52 this.PreviewLabel = new System.Windows.Forms.Label(); 48 this.ErrorTextBox = new System.Windows.Forms.TextBox();49 53 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); 53 55 ((System.ComponentModel.ISupportInitialize)(this.TrainingTestTrackBar)).BeginInit(); 54 56 this.CSVSettingsGroupBox.SuspendLayout(); … … 123 125 this.CancelButton.UseVisualStyleBackColor = true; 124 126 // 125 // openFileButton127 // OpenFileButton 126 128 // 127 129 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; 128 131 this.OpenFileButton.Location = new System.Drawing.Point(429, 3); 129 this.OpenFileButton.Name = " openFileButton";132 this.OpenFileButton.Name = "OpenFileButton"; 130 133 this.OpenFileButton.Size = new System.Drawing.Size(24, 24); 131 134 this.OpenFileButton.TabIndex = 8; 132 this.OpenFileButton.Text = "Open";133 135 this.OpenFileButton.UseVisualStyleBackColor = true; 134 this.OpenFileButton.Click += new System.EventHandler(this. openFileButton_Click);136 this.OpenFileButton.Click += new System.EventHandler(this.OpenFileButtonClick); 135 137 // 136 138 // ProblemFileLabel … … 224 226 this.CSVSettingsGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 225 227 | System.Windows.Forms.AnchorStyles.Right))); 226 this.CSVSettingsGroupBox.Controls.Add(this.DateTimeFormatInfo Button);227 this.CSVSettingsGroupBox.Controls.Add(this.DecimalSeparatorInfo Button);228 this.CSVSettingsGroupBox.Controls.Add(this.SeparatorInfo Button);228 this.CSVSettingsGroupBox.Controls.Add(this.DateTimeFormatInfoLabel); 229 this.CSVSettingsGroupBox.Controls.Add(this.DecimalSeparatorInfoLabel); 230 this.CSVSettingsGroupBox.Controls.Add(this.SeparatorInfoLabel); 229 231 this.CSVSettingsGroupBox.Controls.Add(this.SeparatorComboBox); 230 232 this.CSVSettingsGroupBox.Controls.Add(this.DateTimeFormatComboBox); … … 240 242 this.CSVSettingsGroupBox.Text = "CSV Settings"; 241 243 // 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); 251 276 // 252 277 // ProblemDataSettingsGroupBox … … 255 280 | System.Windows.Forms.AnchorStyles.Left) 256 281 | 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); 258 284 this.ProblemDataSettingsGroupBox.Controls.Add(this.PreviewLabel); 259 this.ProblemDataSettingsGroupBox.Controls.Add(this.ErrorTextBox);260 285 this.ProblemDataSettingsGroupBox.Controls.Add(this.TestLabel); 261 286 this.ProblemDataSettingsGroupBox.Controls.Add(this.PreviewDatasetMatrix); … … 270 295 this.ProblemDataSettingsGroupBox.Text = "ProblemData Settings"; 271 296 // 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 // 272 316 // PreviewLabel 273 317 // … … 278 322 this.PreviewLabel.TabIndex = 7; 279 323 this.PreviewLabel.Text = "Preview"; 280 //281 // ErrorTextBox282 //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;289 324 // 290 325 // PreviewDatasetMatrix … … 302 337 this.PreviewDatasetMatrix.Size = new System.Drawing.Size(435, 144); 303 338 this.PreviewDatasetMatrix.TabIndex = 0; 304 //305 // DecimalSeparatorInfoButtin306 //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 // DateTimeFormatInfoButton316 //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 // ShuffleDataInfoButton326 //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;334 339 // 335 340 // DataAnalysisImportTypeDialog … … 385 390 protected System.Windows.Forms.TextBox ErrorTextBox; 386 391 protected HeuristicLab.Data.Views.StringConvertibleMatrixView PreviewDatasetMatrix; 387 pr ivateSystem.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; 393 398 } 394 399 } -
branches/DataAnalysisCSVImport/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/DataAnalysisImportTypeDialog.cs
r8701 r8715 26 26 using System.Linq; 27 27 using System.Windows.Forms; 28 using HeuristicLab.Co mmon.Resources;28 using HeuristicLab.Core.Views; 29 29 using HeuristicLab.Problems.DataAnalysis; 30 30 … … 75 75 public DataAnalysisImportTypeDialog() { 76 76 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); 87 81 88 82 SeparatorComboBox.DataSource = POSSIBLE_SEPARATORS; … … 102 96 } 103 97 104 pr ivate void openFileButton_Click(object sender, System.EventArgs e) {98 protected virtual void OpenFileButtonClick(object sender, System.EventArgs e) { 105 99 if (openFileDialog.ShowDialog(this) == DialogResult.OK) { 106 100 ProblemTextBox.Text = openFileDialog.FileName; … … 109 103 } 110 104 111 protected v oid CSVFormatComboBoxSelectionChangeCommitted(object sender, EventArgs e) {105 protected virtual void CSVFormatComboBoxSelectionChangeCommitted(object sender, EventArgs e) { 112 106 if (!ProblemTextBox.Text.Equals(String.Empty)) { 113 107 ParseCSVFile(); … … 123 117 (DateTimeFormatInfo)DateTimeFormatComboBox.SelectedValue, 124 118 (char)SeparatorComboBox.SelectedValue); 125 OkButton.Enabled = true;126 119 IEnumerable<string> variableNamesWithType = GetVariableNamesWithType(csvParser); 127 120 PreviewDatasetMatrix.Content = new Dataset(variableNamesWithType, csvParser.Values); 128 var bla = new Dataset(csvParser.VariableNames, csvParser.Values);129 121 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 133 124 ErrorTextBox.Text = String.Empty; 134 125 ErrorTextBox.Visible = false; 126 OkButton.Enabled = true; 135 127 } 136 128 catch (Exception ex) { … … 138 130 ErrorTextBox.Text = ex.Message; 139 131 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!"); 140 138 } 141 139 } … … 156 154 return variableNamesWithType; 157 155 } 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 } 158 165 } 159 166 } -
branches/DataAnalysisCSVImport/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/DataAnalysisInstanceConsumerView.cs
r8701 r8715 30 30 [View("DataAnalysis InstanceProvider View")] 31 31 [Content(typeof(IProblemInstanceConsumer<IDataAnalysisProblemData>), IsDefaultView = true)] 32 [Content(typeof(IProblemInstanceConsumer<IRegressionProblemData>), IsDefaultView = true)]33 32 [Content(typeof(IProblemInstanceConsumer<IClusteringProblemData>), IsDefaultView = true)] 34 33 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 38 38 </PropertyGroup> 39 39 <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> 42 42 </Reference> 43 43 <Reference Include="HeuristicLab.Common.Resources-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 44 44 <Private>False</Private> 45 45 </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> 48 51 </Reference> 49 52 <Reference Include="HeuristicLab.Data-3.3"> 50 53 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath> 54 <Private>False</Private> 51 55 </Reference> 52 56 <Reference Include="HeuristicLab.Data.Views-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> … … 55 59 <Reference Include="HeuristicLab.MainForm-3.3"> 56 60 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.MainForm-3.3.dll</HintPath> 61 <Private>False</Private> 57 62 </Reference> 58 63 <Reference Include="HeuristicLab.MainForm.WindowsForms-3.3"> 59 64 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.MainForm.WindowsForms-3.3.dll</HintPath> 65 <Private>False</Private> 60 66 </Reference> 61 67 <Reference Include="HeuristicLab.PluginInfrastructure-3.3"> 62 68 <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> 66 70 </Reference> 67 71 <Reference Include="HeuristicLab.Problems.Instances-3.3"> 68 72 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.Instances-3.3.dll</HintPath> 73 <Private>False</Private> 69 74 </Reference> 70 75 <Reference Include="HeuristicLab.Problems.Instances.Views-3.3"> 71 76 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.Instances.Views-3.3.dll</HintPath> 77 <Private>False</Private> 72 78 </Reference> 73 79 <Reference Include="System"> 74 <Private> True</Private>80 <Private>False</Private> 75 81 </Reference> 76 82 <Reference Include="System.Core"> 77 <Private> True</Private>83 <Private>False</Private> 78 84 </Reference> 79 85 <Reference Include="System.Drawing"> 80 <Private> True</Private>86 <Private>False</Private> 81 87 </Reference> 82 88 <Reference Include="System.Windows.Forms"> 83 <Private> True</Private>89 <Private>False</Private> 84 90 </Reference> 85 91 <Reference Include="System.Xml.Linq"> 86 <Private> True</Private>92 <Private>False</Private> 87 93 </Reference> 88 94 <Reference Include="System.Data.DataSetExtensions"> 89 <Private> True</Private>95 <Private>False</Private> 90 96 </Reference> 91 97 <Reference Include="Microsoft.CSharp"> 92 <Private> True</Private>98 <Private>False</Private> 93 99 </Reference> 94 100 <Reference Include="System.Data"> 95 <Private> True</Private>101 <Private>False</Private> 96 102 </Reference> 97 103 <Reference Include="System.Xml"> 98 <Private> True</Private>104 <Private>False</Private> 99 105 </Reference> 100 106 </ItemGroup> … … 111 117 <Compile Include="ClassificationInstanceConsumerView.Designer.cs"> 112 118 <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> 113 131 </Compile> 114 132 <Compile Include="DataAnalysisImportTypeDialog.cs"> … … 131 149 </ItemGroup> 132 150 <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> 133 156 <ProjectReference Include="..\..\HeuristicLab.Problems.Instances.DataAnalysis\3.3\HeuristicLab.Problems.Instances.DataAnalysis-3.3.csproj"> 134 157 <Project>{94C7714E-29D4-4D6D-B213-2C18D627AB75}</Project> -
branches/DataAnalysisCSVImport/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/Plugin.cs.frame
r8598 r8715 25 25 [Plugin("HeuristicLab.Problems.Instances.DataAnalysis.Views", "3.3.7.$WCREV$")] 26 26 [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")] 27 31 [PluginDependency("HeuristicLab.MainForm", "3.3")] 32 [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")] 28 33 [PluginDependency("HeuristicLab.Problems.DataAnalysis", "3.4")] 29 34 [PluginDependency("HeuristicLab.Problems.Instances", "3.3")] -
branches/DataAnalysisCSVImport/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Classification/CSV/ClassifiactionCSVInstanceProvider.cs
r8701 r8715 76 76 } 77 77 } else { 78 allowedInputVars.AddRange(dataset.DoubleVariables.Where(x => x.Equals(targetVar)));78 allowedInputVars.AddRange(dataset.DoubleVariables.Where(x => !x.Equals(targetVar))); 79 79 } 80 80 … … 96 96 List<IList> values = csvFileParser.Values; 97 97 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); 99 100 } 100 101 101 102 Dataset dataset = new Dataset(csvFileParser.VariableNames, values); 102 string targetVar = dataset.DoubleVariables.Last();103 103 104 104 // turn of input variables that are constant in the training partition 105 105 var allowedInputVars = new List<string>(); 106 106 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); 114 118 115 119 classificationData.TrainingPartition.Start = 0; … … 123 127 } 124 128 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) { 127 130 IList targetValues = values[target]; 128 131 var group = targetValues.Cast<double>().GroupBy(x => x).Select(g => new { Key = g.Key, Count = g.Count() }).ToList(); 129 132 Dictionary<double, double> taken = new Dictionary<double, double>(); 130 133 foreach (var classCount in group) { 131 taken[classCount.Key] = (classCount.Count * trainingPercentage) / 100 ;134 taken[classCount.Key] = (classCount.Count * trainingPercentage) / 100.0; 132 135 } 133 136 … … 143 146 } 144 147 } 148 149 trainingPartEnd = training.First().Count; 145 150 146 151 training = Shuffle(training); -
branches/DataAnalysisCSVImport/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Classification/ClassificationImportType.cs
r8701 r8715 22 22 namespace HeuristicLab.Problems.Instances.DataAnalysis { 23 23 public class ClassificationImportType : DataAnalysisImportType { 24 public string Variable { get; set; }24 public string TargetVariable { get; set; } 25 25 } 26 26 } -
branches/DataAnalysisCSVImport/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Clustering/CSV/ClusteringCSVInstanceProvider.cs
r8701 r8715 75 75 } 76 76 } else { 77 allowedInputVars.AddRange(dataset.DoubleVariables.Where(x => x.Equals(targetVar)));77 allowedInputVars.AddRange(dataset.DoubleVariables.Where(x => !x.Equals(targetVar))); 78 78 } 79 79 … … 104 104 int trainingPartEnd = (csvFileParser.Rows * type.Training) / 100; 105 105 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))); 110 114 } 111 115 -
branches/DataAnalysisCSVImport/HeuristicLab.Problems.Instances.DataAnalysis/3.3/HeuristicLab.Problems.Instances.DataAnalysis-3.3.csproj
r8701 r8715 98 98 </PropertyGroup> 99 99 <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"> 110 104 <Private>False</Private> 111 105 </Reference> … … 164 158 <Compile Include="Regression\ArtificialRegressionDataDescriptor.cs" /> 165 159 <Compile Include="Regression\ArtificialRegressionInstanceProvider.cs" /> 160 <Compile Include="Regression\RegressionImportType.cs" /> 166 161 <Compile Include="Regression\CSV\RegressionCSVInstanceProvider.cs" /> 167 162 <Compile Include="Regression\Keijzer\KeijzerFunctionFourteen.cs" /> -
branches/DataAnalysisCSVImport/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/CSV/RegressionCSVInstanceProvider.cs
r8701 r8715 67 67 var allowedInputVars = new List<string>(); 68 68 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))); 73 77 } 74 78 … … 86 90 } 87 91 88 protected override IRegressionProblemData ImportData(string path, DataAnalysisImportType type, TableFileParser csvFileParser) {92 protected override IRegressionProblemData ImportData(string path, RegressionImportType type, TableFileParser csvFileParser) { 89 93 List<IList> values = csvFileParser.Values; 90 94 if (type.Shuffle) { … … 92 96 } 93 97 Dataset dataset = new Dataset(csvFileParser.VariableNames, values); 94 string targetVar = dataset.DoubleVariables.Last();95 98 96 99 // turn of input variables that are constant in the training partition … … 102 105 foreach (var variableName in dataset.DoubleVariables) { 103 106 if (dataset.GetDoubleValues(variableName, trainingIndizes).Range() > 0 && 104 variableName != t argetVar)107 variableName != type.TargetVariable) 105 108 allowedInputVars.Add(variableName); 106 109 } 107 110 } else { 108 allowedInputVars.AddRange(dataset.DoubleVariables.Where(x => x.Equals(targetVar)));111 allowedInputVars.AddRange(dataset.DoubleVariables.Where(x => !x.Equals(type.TargetVariable))); 109 112 } 110 113 111 RegressionProblemData regressionData = new RegressionProblemData(dataset, allowedInputVars, t argetVar);114 RegressionProblemData regressionData = new RegressionProblemData(dataset, allowedInputVars, type.TargetVariable); 112 115 113 116 regressionData.TrainingPartition.Start = 0; -
branches/DataAnalysisCSVImport/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/RegressionInstanceProvider.cs
r8701 r8715 23 23 24 24 namespace HeuristicLab.Problems.Instances.DataAnalysis { 25 public abstract class RegressionInstanceProvider : DataAnalysisInstanceProvider<IRegressionProblemData, DataAnalysisImportType> {25 public abstract class RegressionInstanceProvider : DataAnalysisInstanceProvider<IRegressionProblemData, RegressionImportType> { 26 26 } 27 27 }
Note: See TracChangeset
for help on using the changeset viewer.