Free cookie consent management tool by TermsFeed Policy Generator

Changeset 7610


Ignore:
Timestamp:
03/13/12 15:33:19 (12 years ago)
Author:
sforsten
Message:

#1784:

  • added export button and corrected the LoadData in RegressionInstanceProvider
  • added RegressionProblemView
Location:
branches/ProblemInstancesRegressionAndClassification
Files:
2 added
18 edited

Legend:

Unmodified
Added
Removed
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab 3.3.sln

    r7603 r7610  
    1717EndProject
    1818Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.Instances.Regression.Views-3.4", "HeuristicLab.Problems.Instances.Regression.Views\3.4\HeuristicLab.Problems.Instances.Regression.Views-3.4.csproj", "{1CC61973-7706-42DC-8023-310F591AB02B}"
     19EndProject
     20Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Optimization.Views-3.3", "HeuristicLab.Optimization.Views\3.3\HeuristicLab.Optimization.Views-3.3.csproj", "{662B4B15-8F4D-4AE5-B3EB-D91C215F5AF2}"
    1921EndProject
    2022Global
     
    8082    {1CC61973-7706-42DC-8023-310F591AB02B}.Release|x64.ActiveCfg = Release|Any CPU
    8183    {1CC61973-7706-42DC-8023-310F591AB02B}.Release|x86.ActiveCfg = Release|Any CPU
     84    {662B4B15-8F4D-4AE5-B3EB-D91C215F5AF2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
     85    {662B4B15-8F4D-4AE5-B3EB-D91C215F5AF2}.Debug|Any CPU.Build.0 = Debug|Any CPU
     86    {662B4B15-8F4D-4AE5-B3EB-D91C215F5AF2}.Debug|x64.ActiveCfg = Debug|x64
     87    {662B4B15-8F4D-4AE5-B3EB-D91C215F5AF2}.Debug|x64.Build.0 = Debug|x64
     88    {662B4B15-8F4D-4AE5-B3EB-D91C215F5AF2}.Debug|x86.ActiveCfg = Debug|x86
     89    {662B4B15-8F4D-4AE5-B3EB-D91C215F5AF2}.Debug|x86.Build.0 = Debug|x86
     90    {662B4B15-8F4D-4AE5-B3EB-D91C215F5AF2}.Release|Any CPU.ActiveCfg = Release|Any CPU
     91    {662B4B15-8F4D-4AE5-B3EB-D91C215F5AF2}.Release|Any CPU.Build.0 = Release|Any CPU
     92    {662B4B15-8F4D-4AE5-B3EB-D91C215F5AF2}.Release|x64.ActiveCfg = Release|x64
     93    {662B4B15-8F4D-4AE5-B3EB-D91C215F5AF2}.Release|x64.Build.0 = Release|x64
     94    {662B4B15-8F4D-4AE5-B3EB-D91C215F5AF2}.Release|x86.ActiveCfg = Release|x86
     95    {662B4B15-8F4D-4AE5-B3EB-D91C215F5AF2}.Release|x86.Build.0 = Release|x86
    8296  EndGlobalSection
    8397  GlobalSection(SolutionProperties) = preSolution
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Optimization.Views/3.3/HeuristicLab.Optimization.Views-3.3.csproj

    r7558 r7610  
    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>
     
    9999  </PropertyGroup>
    100100  <ItemGroup>
     101    <Reference Include="HeuristicLab.Collections-3.3">
     102      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Collections-3.3.dll</HintPath>
     103    </Reference>
     104    <Reference Include="HeuristicLab.Common-3.3">
     105      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath>
     106    </Reference>
     107    <Reference Include="HeuristicLab.Common.Resources-3.3">
     108      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common.Resources-3.3.dll</HintPath>
     109    </Reference>
     110    <Reference Include="HeuristicLab.Core-3.3">
     111      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath>
     112    </Reference>
     113    <Reference Include="HeuristicLab.Core.Views-3.3">
     114      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Core.Views-3.3.dll</HintPath>
     115    </Reference>
     116    <Reference Include="HeuristicLab.Data-3.3">
     117      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath>
     118    </Reference>
     119    <Reference Include="HeuristicLab.Data.Views-3.3">
     120      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Data.Views-3.3.dll</HintPath>
     121    </Reference>
     122    <Reference Include="HeuristicLab.MainForm-3.3">
     123      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.MainForm-3.3.dll</HintPath>
     124    </Reference>
     125    <Reference Include="HeuristicLab.MainForm.WindowsForms-3.3">
     126      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.MainForm.WindowsForms-3.3.dll</HintPath>
     127    </Reference>
     128    <Reference Include="HeuristicLab.Optimization-3.3">
     129      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
     130    </Reference>
     131    <Reference Include="HeuristicLab.Persistence-3.3">
     132      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Persistence-3.3.dll</HintPath>
     133    </Reference>
     134    <Reference Include="HeuristicLab.PluginInfrastructure-3.3">
     135      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
     136    </Reference>
     137    <Reference Include="HeuristicLab.Visualization.ChartControlsExtensions-3.3">
     138      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Visualization.ChartControlsExtensions-3.3.dll</HintPath>
     139    </Reference>
    101140    <Reference Include="Microsoft.CSharp" />
    102141    <Reference Include="System" />
     
    115154    <Reference Include="System.Data" />
    116155    <Reference Include="System.Xml" />
    117     <Reference Include="WeifenLuo.WinFormsUI.Docking-2.3.1, Version=2.3.1.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86" />
     156    <Reference Include="WeifenLuo.WinFormsUI.Docking-2.3.1">
     157      <HintPath>..\..\..\..\trunk\sources\bin\WeifenLuo.WinFormsUI.Docking-2.3.1.dll</HintPath>
     158    </Reference>
    118159  </ItemGroup>
    119160  <ItemGroup>
     
    289330  </ItemGroup>
    290331  <ItemGroup>
    291     <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj">
    292       <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project>
    293       <Name>HeuristicLab.Collections-3.3</Name>
    294       <Private>False</Private>
    295     </ProjectReference>
    296     <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj">
    297       <Project>{0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}</Project>
    298       <Name>HeuristicLab.Common.Resources-3.3</Name>
    299       <Private>False</Private>
    300     </ProjectReference>
    301     <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">
    302       <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project>
    303       <Name>HeuristicLab.Common-3.3</Name>
    304       <Private>False</Private>
    305     </ProjectReference>
    306     <ProjectReference Include="..\..\HeuristicLab.Core.Views\3.3\HeuristicLab.Core.Views-3.3.csproj">
    307       <Project>{E226881D-315F-423D-B419-A766FE0D8685}</Project>
    308       <Name>HeuristicLab.Core.Views-3.3</Name>
    309       <Private>False</Private>
    310     </ProjectReference>
    311     <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj">
    312       <Project>{C36BD924-A541-4A00-AFA8-41701378DDC5}</Project>
    313       <Name>HeuristicLab.Core-3.3</Name>
    314       <Private>False</Private>
    315     </ProjectReference>
    316     <ProjectReference Include="..\..\HeuristicLab.Data.Views\3.3\HeuristicLab.Data.Views-3.3.csproj">
    317       <Project>{72104A0B-90E7-42F3-9ABE-9BBBADD4B943}</Project>
    318       <Name>HeuristicLab.Data.Views-3.3</Name>
    319       <Private>False</Private>
    320     </ProjectReference>
    321     <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj">
    322       <Project>{BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}</Project>
    323       <Name>HeuristicLab.Data-3.3</Name>
    324       <Private>False</Private>
    325     </ProjectReference>
    326     <ProjectReference Include="..\..\HeuristicLab.MainForm.WindowsForms\3.3\HeuristicLab.MainForm.WindowsForms-3.3.csproj">
    327       <Project>{AB687BBE-1BFE-476B-906D-44237135431D}</Project>
    328       <Name>HeuristicLab.MainForm.WindowsForms-3.3</Name>
    329       <Private>False</Private>
    330     </ProjectReference>
    331     <ProjectReference Include="..\..\HeuristicLab.MainForm\3.3\HeuristicLab.MainForm-3.3.csproj">
    332       <Project>{3BD61258-31DA-4B09-89C0-4F71FEF5F05A}</Project>
    333       <Name>HeuristicLab.MainForm-3.3</Name>
    334       <Private>False</Private>
    335     </ProjectReference>
    336     <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj">
    337       <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project>
    338       <Name>HeuristicLab.Optimization-3.3</Name>
    339       <Private>False</Private>
    340     </ProjectReference>
    341     <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj">
    342       <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project>
    343       <Name>HeuristicLab.Persistence-3.3</Name>
    344       <Private>False</Private>
    345     </ProjectReference>
    346     <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj">
    347       <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
    348       <Name>HeuristicLab.PluginInfrastructure-3.3</Name>
    349       <Private>False</Private>
    350     </ProjectReference>
    351332    <ProjectReference Include="..\..\HeuristicLab.Problems.Instances\3.3\HeuristicLab.Problems.Instances-3.3.csproj">
    352333      <Project>{3540E29E-4793-49E7-8EE2-FEA7F61C3994}</Project>
    353334      <Name>HeuristicLab.Problems.Instances-3.3</Name>
    354     </ProjectReference>
    355     <ProjectReference Include="..\..\HeuristicLab.Visualization.ChartControlsExtensions\3.3\HeuristicLab.Visualization.ChartControlsExtensions-3.3.csproj">
    356       <Project>{315BDA09-3F4F-49B3-9790-B37CFC1C5750}</Project>
    357       <Name>HeuristicLab.Visualization.ChartControlsExtensions-3.3</Name>
    358       <Private>False</Private>
    359335    </ProjectReference>
    360336  </ItemGroup>
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Optimization.Views/3.3/ProblemInstanceProviderView.Designer.cs

    r7558 r7610  
    5252      this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
    5353      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
     54      this.exportButton = new System.Windows.Forms.Button();
     55      this.saveFileDialog = new System.Windows.Forms.SaveFileDialog();
    5456      this.SuspendLayout();
    5557      //
     
    5759      //
    5860      this.loadButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    59       this.loadButton.Location = new System.Drawing.Point(549, -1);
     61      this.loadButton.Location = new System.Drawing.Point(601, -1);
    6062      this.loadButton.Name = "loadButton";
    6163      this.loadButton.Size = new System.Drawing.Size(26, 23);
     
    7678      // instancesComboBox
    7779      //
    78       this.instancesComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
     80      this.instancesComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    7981            | System.Windows.Forms.AnchorStyles.Right)));
    8082      this.instancesComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     
    8284      this.instancesComboBox.Location = new System.Drawing.Point(54, 0);
    8385      this.instancesComboBox.Name = "instancesComboBox";
    84       this.instancesComboBox.Size = new System.Drawing.Size(489, 21);
     86      this.instancesComboBox.Size = new System.Drawing.Size(541, 21);
    8587      this.instancesComboBox.TabIndex = 7;
    8688      this.instancesComboBox.DataSourceChanged += new System.EventHandler(this.comboBox_DataSourceChanged);
     
    8991      //
    9092      this.importButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    91       this.importButton.Location = new System.Drawing.Point(581, -1);
     93      this.importButton.Location = new System.Drawing.Point(633, -1);
    9294      this.importButton.Name = "importButton";
    9395      this.importButton.Size = new System.Drawing.Size(26, 23);
     
    102104      this.openFileDialog.Filter = "All files|*.*";
    103105      //
     106      // exportButton
     107      //
     108      this.exportButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     109      this.exportButton.Location = new System.Drawing.Point(665, -1);
     110      this.exportButton.Name = "exportButton";
     111      this.exportButton.Size = new System.Drawing.Size(26, 23);
     112      this.exportButton.TabIndex = 8;
     113      this.exportButton.Text = "Export";
     114      this.exportButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
     115      this.exportButton.UseVisualStyleBackColor = true;
     116      this.exportButton.Click += new System.EventHandler(this.exportButton_Click);
     117      //
     118      // saveFileDialog
     119      //
     120      this.saveFileDialog.Filter = "CSV files|*.csv|All files|*.*";
     121      this.saveFileDialog.Title = "Save RegressionInstance...";
     122      //
    104123      // ProblemInstanceProviderView
    105124      //
    106125      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    107126      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     127      this.Controls.Add(this.exportButton);
    108128      this.Controls.Add(this.instancesComboBox);
    109129      this.Controls.Add(this.importButton);
     
    111131      this.Controls.Add(this.instanceLabel);
    112132      this.Name = "ProblemInstanceProviderView";
    113       this.Size = new System.Drawing.Size(610, 21);
     133      this.Size = new System.Drawing.Size(694, 21);
    114134      this.ResumeLayout(false);
    115135      this.PerformLayout();
     
    125145    protected System.Windows.Forms.ComboBox instancesComboBox;
    126146    protected System.Windows.Forms.Button importButton;
     147    protected System.Windows.Forms.Button exportButton;
     148    private System.Windows.Forms.SaveFileDialog saveFileDialog;
    127149
    128150  }
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Optimization.Views/3.3/ProblemInstanceProviderView.cs

    r7558 r7610  
    2727using HeuristicLab.MainForm;
    2828using HeuristicLab.MainForm.WindowsForms;
     29using HeuristicLab.PluginInfrastructure;
    2930using HeuristicLab.Problems.Instances;
    3031
     
    4445      importButton.Image = VSImageLibrary.Open;
    4546      toolTip.SetToolTip(importButton, "Import a " + GetProblemType() + " instance from file.");
     47      exportButton.Text = String.Empty;
     48      exportButton.Image = VSImageLibrary.Save;
     49      toolTip.SetToolTip(exportButton, "Export a " + GetProblemType() + " instance to a file.");
    4650      loadButton.Text = String.Empty;
    4751      loadButton.Image = VSImageLibrary.Checkout;
     
    7074      try {
    7175        Content.Consumer.Load(instance);
    72       } catch (Exception ex) {
     76      }
     77      catch (Exception ex) {
    7378        MessageBox.Show(String.Format("This problem does not support loading the instance {0}: {1}", descriptor.Name, Environment.NewLine + ex.Message), "Cannot load instance");
    7479      }
     
    8186        try {
    8287          instance = Content.LoadData(openFileDialog.FileName);
    83         } catch (Exception ex) {
     88        }
     89        catch (Exception ex) {
    8490          MessageBox.Show(String.Format("There was an error parsing the file: {0}", Environment.NewLine + ex.Message), "Error while parsing", MessageBoxButtons.OK, MessageBoxIcon.Error);
    8591          return;
     
    8793        try {
    8894          Content.Consumer.Load(instance);
    89         } catch (Exception ex) {
     95        }
     96        catch (Exception ex) {
    9097          MessageBox.Show(String.Format("This problem does not support loading the instance {0}: {1}", Path.GetFileName(openFileDialog.FileName), Environment.NewLine + ex.Message), "Cannot load instance");
     98        }
     99      }
     100    }
     101
     102    protected virtual void exportButton_Click(object sender, EventArgs e) {
     103      if (saveFileDialog.ShowDialog(this) == DialogResult.OK) {
     104        try {
     105          var descriptor = (IDataDescriptor)instancesComboBox.SelectedItem;
     106          var instance = Content.LoadData(descriptor);
     107          Content.SaveData(instance, saveFileDialog.FileName);
     108        }
     109        catch (Exception ex) {
     110          ErrorHandling.ShowErrorDialog(this, ex);
    91111        }
    92112      }
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis.Views/3.4/DataAnalysisProblemView.cs

    r7603 r7610  
    2929  [View("DataAnalysisProblem View")]
    3030  [Content(typeof(IDataAnalysisProblem), true)]
    31   public partial class DataAnalysisProblemView : HeuristicOptimizationProblemView {
     31  public partial class DataAnalysisProblemView : ProblemView {
    3232    public DataAnalysisProblemView() {
    3333      InitializeComponent();
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj

    r7603 r7610  
    123123      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
    124124    </Reference>
    125     <Reference Include="HeuristicLab.Optimization.Views-3.3">
    126       <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Optimization.Views-3.3.dll</HintPath>
    127     </Reference>
    128125    <Reference Include="HeuristicLab.Optimizer-3.3">
    129126      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Optimizer-3.3.dll</HintPath>
     
    177174    </Compile>
    178175    <Compile Include="Plugin.cs" />
     176    <Compile Include="Regression\RegressionProblemView.cs">
     177      <SubType>UserControl</SubType>
     178    </Compile>
     179    <Compile Include="Regression\RegressionProblemView.Designer.cs">
     180      <DependentUpon>RegressionProblemView.cs</DependentUpon>
     181    </Compile>
    179182    <Compile Include="Regression\RegressionSolutionErrorCharacteristicsCurveView.cs">
    180183      <SubType>UserControl</SubType>
     
    308311    <None Include="Plugin.cs.frame" />
    309312    <None Include="Properties\AssemblyInfo.cs.frame" />
    310     <Compile Include="DataAnalysisProblemView.cs" />
     313    <Compile Include="DataAnalysisProblemView.cs">
     314      <SubType>UserControl</SubType>
     315    </Compile>
    311316    <Compile Include="DataAnalysisProblemView.Designer.cs">
    312317      <DependentUpon>DataAnalysisProblemView.cs</DependentUpon>
     
    315320  </ItemGroup>
    316321  <ItemGroup>
     322    <ProjectReference Include="..\..\HeuristicLab.Optimization.Views\3.3\HeuristicLab.Optimization.Views-3.3.csproj">
     323      <Project>{662B4B15-8F4D-4AE5-B3EB-D91C215F5AF2}</Project>
     324      <Name>HeuristicLab.Optimization.Views-3.3</Name>
     325    </ProjectReference>
    317326    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis\3.4\HeuristicLab.Problems.DataAnalysis-3.4.csproj">
    318327      <Project>{DF87C13E-A889-46FF-8153-66DCAA8C5674}</Project>
    319328      <Name>HeuristicLab.Problems.DataAnalysis-3.4</Name>
    320329      <Private>False</Private>
     330    </ProjectReference>
     331    <ProjectReference Include="..\..\HeuristicLab.Problems.Instances\3.3\HeuristicLab.Problems.Instances-3.3.csproj">
     332      <Project>{3540E29E-4793-49E7-8EE2-FEA7F61C3994}</Project>
     333      <Name>HeuristicLab.Problems.Instances-3.3</Name>
    321334    </ProjectReference>
    322335  </ItemGroup>
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis.Views/3.4/Plugin.cs.frame

    r7603 r7610  
    4343  [PluginDependency("HeuristicLab.Persistence", "3.3")]
    4444  [PluginDependency("HeuristicLab.Problems.DataAnalysis", "3.4")]
     45  [PluginDependency("HeuristicLab.Problems.Instances", "3.3")]
    4546  [PluginDependency("HeuristicLab.Visualization.ChartControlsExtensions", "3.3")]
    4647  public class HeuristicLabProblemsDataAnalysisViewsPlugin : PluginBase {
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblem.cs

    r7603 r7610  
    2929  [Item("Regression Problem", "A general regression problem.")]
    3030  [Creatable("Problems")]
    31   public class RegressionProblem : DataAnalysisProblem<IRegressionProblemData>, IRegressionProblem, IStorableContent {
     31  public class RegressionProblem : DataAnalysisProblem<IRegressionProblemData>, IRegressionProblem, IStorableContent,
     32    IProblemInstanceConsumer<RegressionData> {
    3233    public string Filename { get; set; }
    3334
     
    5253      Dataset dataset = new Dataset(data.InputVariables, data.Values);
    5354      ProblemData = new RegressionProblemData(dataset, data.AllowedInputVariables, data.TargetVariable);
     55      ProblemData.TrainingPartition.Start = data.TrainingPartitionStart;
     56      ProblemData.TrainingPartition.End = data.TrainingPartitionEnd;
     57      ProblemData.TestPartition.Start = data.TestPartitionStart;
     58      ProblemData.TestPartition.End = data.TestPartitionEnd;
    5459      OnReset();
    5560    }
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionProblem.cs

    r7603 r7610  
    2020#endregion
    2121
    22 using HeuristicLab.Problems.Instances;
    2322namespace HeuristicLab.Problems.DataAnalysis {
    24   public interface IRegressionProblem : IDataAnalysisProblem<IRegressionProblemData>, IProblemInstanceConsumer<RegressionData> {
     23  public interface IRegressionProblem : IDataAnalysisProblem<IRegressionProblemData> {
    2524  }
    2625}
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.Instances.Regression.Views/3.4

    • Property svn:ignore set to
      Plugin.cs
      bin
      obj
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.Instances.Regression.Views/3.4/HeuristicLab.Problems.Instances.Regression.Views-3.4.csproj

    r7603 r7610  
    4141    <Reference Include="HeuristicLab.MainForm-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
    4242    <Reference Include="HeuristicLab.MainForm.WindowsForms-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
    43     <Reference Include="HeuristicLab.Optimization.Views-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
     43    <Reference Include="HeuristicLab.PluginInfrastructure-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
    4444    <Reference Include="System" />
    4545    <Reference Include="System.Core" />
     
    5353  </ItemGroup>
    5454  <ItemGroup>
     55    <Compile Include="Plugin.cs" />
    5556    <Compile Include="Properties\AssemblyInfo.cs" />
    5657    <Compile Include="RegressionInstanceProviderView.cs">
     
    6768  </ItemGroup>
    6869  <ItemGroup>
     70    <ProjectReference Include="..\..\HeuristicLab.Optimization.Views\3.3\HeuristicLab.Optimization.Views-3.3.csproj">
     71      <Project>{662B4B15-8F4D-4AE5-B3EB-D91C215F5AF2}</Project>
     72      <Name>HeuristicLab.Optimization.Views-3.3</Name>
     73    </ProjectReference>
    6974    <ProjectReference Include="..\..\HeuristicLab.Problems.Instances.Regression\3.4\HeuristicLab.Problems.Instances.Regression-3.4.csproj">
    7075      <Project>{26BF13E1-C8B2-4ACE-862D-EBFD360116B3}</Project>
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.Instances.Regression.Views/3.4/Properties/AssemblyInfo.cs

    r7603 r7610  
    1 using System.Reflection;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22using System.Reflection;
    223using System.Runtime.CompilerServices;
    324using System.Runtime.InteropServices;
     
    627// set of attributes. Change these attribute values to modify the information
    728// associated with an assembly.
    8 [assembly: AssemblyTitle("HeuristicLab.Problems.Instances.Regression.Views-3.4")]
     29[assembly: AssemblyTitle("HeuristicLab.Problems.Instances.Regression.View")]
    930[assembly: AssemblyDescription("")]
    1031[assembly: AssemblyConfiguration("")]
    11 [assembly: AssemblyCompany("")]
    12 [assembly: AssemblyProduct("HeuristicLab.Problems.Instances.Regression.Views-3.4")]
    13 [assembly: AssemblyCopyright("Copyright ©  2012")]
     32[assembly: AssemblyCompany("HEAL")]
     33[assembly: AssemblyProduct("HeuristicLab")]
     34[assembly: AssemblyCopyright("(c) 2002-2012 HEAL")]
    1435[assembly: AssemblyTrademark("")]
    1536[assembly: AssemblyCulture("")]
     
    3354// by using the '*' as shown below:
    3455// [assembly: AssemblyVersion("1.0.*")]
    35 [assembly: AssemblyVersion("1.0.0.0")]
    36 [assembly: AssemblyFileVersion("1.0.0.0")]
     56[assembly: AssemblyVersion("3.4.0.0")]
     57[assembly: AssemblyFileVersion("3.4.0.7603")]
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.Instances.Regression/3.4

    • Property svn:ignore set to
      Plugin.cs
      bin
      obj
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.Instances.Regression/3.4/HeuristicLab.Problems.Instances.Regression-3.4.csproj

    r7603 r7610  
    4040    <Reference Include="HeuristicLab.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
    4141    <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
     42    <Reference Include="HeuristicLab.Optimization-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
    4243    <Reference Include="HeuristicLab.PluginInfrastructure-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
    4344    <Reference Include="HeuristicLab.Random-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
     
    5253  <ItemGroup>
    5354    <Compile Include="Keijzer\KeijzerFunctionEight.cs" />
     55    <Compile Include="Plugin.cs" />
    5456    <Compile Include="ResourceRegressionInstanceProvider.cs" />
    5557    <Compile Include="ArtificialRegressionInstanceProvider.cs" />
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.Instances.Regression/3.4/Keijzer/KeijzerInstanceProvider.cs

    r7603 r7610  
    2020#endregion
    2121
    22 
    2322using System;
    2423using System.Collections.Generic;
     24
    2525namespace HeuristicLab.Problems.Instances.Regression {
    26   public class KeijzerInstanceProvider : ArtificialRegressionInstanceProvider {
     26  public class KeijzerInstanceProvider : ArtificialRegressionInstanceProvider, IProblemInstanceProvider<RegressionData> {
    2727    public override string Name {
    2828      get { return "Keijzer Benchmark Problems"; }
     
    4343      return descriptorList;
    4444    }
     45
     46    /*#region delete after test
     47    public RegressionData LoadData(IDataDescriptor descriptor) {
     48      throw new NotImplementedException();
     49    }
     50
     51    public RegressionData LoadData(string path) {
     52      TableFileParser csvFileParser = new TableFileParser();
     53      csvFileParser.Parse(path);
     54
     55      RegressionData regData = new RegressionData();
     56      regData.Name = path;
     57      regData.InputVariables = new List<string>(csvFileParser.VariableNames);
     58      regData.TargetVariable = csvFileParser.VariableNames.Last();
     59      //convert to multidimensional array
     60      double[][] values = csvFileParser.Values.Cast<double[]>().ToArray();
     61      regData.Values = new double[values.GetLength(0), values.GetLength(1)];
     62      for (int i = 0; i < values.GetLength(0); i++) {
     63        for (int j = 0; j < values.GetLength(1); j++) {
     64          regData.Values[i, j] = values[i][j];
     65        }
     66      }
     67
     68      int trainingPartEnd = csvFileParser.Rows * 2 / 3;
     69      regData.TrainingPartitionStart = 0;
     70      regData.TrainingPartitionEnd = trainingPartEnd;
     71      regData.TestPartitionStart = trainingPartEnd;
     72      regData.TestPartitionEnd = csvFileParser.Rows;
     73      return regData;
     74    }
     75
     76    public void SaveData(RegressionData instance, string path) {
     77      StringBuilder strBuilder = new StringBuilder();
     78
     79      foreach (var variable in instance.InputVariables) {
     80        strBuilder.Append(variable + ";");
     81      }
     82      strBuilder.Remove(strBuilder.Length - 1, 1);
     83      strBuilder.AppendLine();
     84
     85      double[,] values = instance.Values;
     86
     87      for (int i = 0; i < values.GetLength(0); i++) {
     88        for (int j = 0; j < values.GetLength(1); j++) {
     89          strBuilder.Append(values[i, j] + ";");
     90        }
     91        strBuilder.Remove(strBuilder.Length - 1, 1);
     92        strBuilder.AppendLine();
     93      }
     94
     95      using (StreamWriter writer = new StreamWriter(path)) {
     96        writer.Write(strBuilder);
     97      }
     98    }
     99    #endregion
     100
     101    #region IProblemInstanceProvider<RegressionData> Members
     102
     103    public IProblemInstanceConsumer<RegressionData> Consumer {
     104      get {
     105        return new RegressionProblem();
     106      }
     107      set {
     108        throw new NotImplementedException();
     109      }
     110    }
     111
     112    #endregion       */
    45113  }
    46114}
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.Instances.Regression/3.4/Properties/AssemblyInfo.cs

    r7603 r7610  
    1 using System.Reflection;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22using System.Reflection;
    223using System.Runtime.CompilerServices;
    324using System.Runtime.InteropServices;
     
    627// set of attributes. Change these attribute values to modify the information
    728// associated with an assembly.
    8 [assembly: AssemblyTitle("HeuristicLab.Problems.Instances.Regression-3.4")]
     29[assembly: AssemblyTitle("HeuristicLab.Problems.Instances.Regression")]
    930[assembly: AssemblyDescription("")]
    1031[assembly: AssemblyConfiguration("")]
    11 [assembly: AssemblyCompany("")]
    12 [assembly: AssemblyProduct("HeuristicLab.Problems.Instances.Regression-3.4")]
    13 [assembly: AssemblyCopyright("Copyright ©  2012")]
     32[assembly: AssemblyCompany("HEAL")]
     33[assembly: AssemblyProduct("HeuristicLab")]
     34[assembly: AssemblyCopyright("(c) 2002-2012 HEAL")]
    1435[assembly: AssemblyTrademark("")]
    1536[assembly: AssemblyCulture("")]
     
    3354// by using the '*' as shown below:
    3455// [assembly: AssemblyVersion("1.0.*")]
    35 [assembly: AssemblyVersion("1.0.0.0")]
    36 [assembly: AssemblyFileVersion("1.0.0.0")]
     56[assembly: AssemblyVersion("3.4.0.0")]
     57[assembly: AssemblyFileVersion("3.4.0.7603")]
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.Instances.Regression/3.4/RegressionInstanceProvider.cs

    r7603 r7610  
    2121
    2222using System;
     23using System.Collections;
    2324using System.Collections.Generic;
    2425using System.IO;
     
    3334
    3435      RegressionData regData = new RegressionData();
    35       regData.Name = path;
     36      int pos = path.LastIndexOf('\\');
     37      if (pos < 0)
     38        regData.Name = path;
     39      else {
     40        pos++;
     41        regData.Name = path.Substring(pos, path.Length - pos);
     42      }
    3643      regData.InputVariables = new List<string>(csvFileParser.VariableNames);
    3744      regData.TargetVariable = csvFileParser.VariableNames.Last();
     45      regData.AllowedInputVariables = regData.InputVariables.Where(x => !x.Equals(regData.TargetVariable));
    3846      //convert to multidimensional array
    39       double[][] values = csvFileParser.Values.Cast<double[]>().ToArray();
    40       regData.Values = new double[values.GetLength(0), values.GetLength(1)];
    41       for (int i = 0; i < values.GetLength(0); i++) {
    42         for (int j = 0; j < values.GetLength(1); j++) {
    43           regData.Values[i, j] = values[i][j];
     47      List<IList> values = csvFileParser.Values;
     48      regData.Values = new double[values.First().Count, values.Count];
     49      for (int i = 0; i < values.Count; i++) {
     50        for (int j = 0; j < values.First().Count; j++) {
     51          regData.Values[j, i] = (double)values[i][j];
    4452        }
    4553      }
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.Instances.Regression/3.4/ValueGenerator.cs

    r7603 r7610  
    3030
    3131    public static double[,] Transformation(List<List<double>> data) {
    32       double[,] values = new double[data.Count, data.First().Count];
     32      double[,] values = new double[data.First().Count, data.Count];
    3333      for (int i = 0; i < values.GetLength(0); i++) {
    3434        for (int j = 0; j < values.GetLength(1); j++) {
    35           values[i, j] = data[i][j];
     35          values[i, j] = data[j][i];
    3636        }
    3737      }
Note: See TracChangeset for help on using the changeset viewer.