Free cookie consent management tool by TermsFeed Policy Generator

Changeset 7750


Ignore:
Timestamp:
04/23/12 16:50:08 (12 years ago)
Author:
sforsten
Message:

#1784:

  • merged Problems.DataAnalysis r7273:7748 from trunk
  • prepared SymbolicClassificationSingleObjectiveProblem and SymbolicRegressionSingleObjectiveProblem to load and export problem instances
Location:
branches/ProblemInstancesRegressionAndClassification
Files:
12 edited
1 copied

Legend:

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

    r7682 r7750  
    2121EndProject
    2222Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.Instances.Classification-3.4", "HeuristicLab.Problems.Instances.Classification\3.4\HeuristicLab.Problems.Instances.Classification-3.4.csproj", "{1BBFCD5B-8A1C-4225-A682-ADEC7800E683}"
     23EndProject
     24Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4", "HeuristicLab.Problems.DataAnalysis.Symbolic.Regression\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.csproj", "{5AC82412-911B-4FA2-A013-EDC5E3F3FCC2}"
     25EndProject
     26Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4", "HeuristicLab.Problems.DataAnalysis.Symbolic.Classification\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4.csproj", "{05BAE4E1-A9FA-4644-AA77-42558720159E}"
    2327EndProject
    2428Global
     
    134138    {1BBFCD5B-8A1C-4225-A682-ADEC7800E683}.Release|x64.ActiveCfg = Release|Any CPU
    135139    {1BBFCD5B-8A1C-4225-A682-ADEC7800E683}.Release|x86.ActiveCfg = Release|Any CPU
     140    {5AC82412-911B-4FA2-A013-EDC5E3F3FCC2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
     141    {5AC82412-911B-4FA2-A013-EDC5E3F3FCC2}.Debug|Any CPU.Build.0 = Debug|Any CPU
     142    {5AC82412-911B-4FA2-A013-EDC5E3F3FCC2}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
     143    {5AC82412-911B-4FA2-A013-EDC5E3F3FCC2}.Debug|Mixed Platforms.Build.0 = Debug|x86
     144    {5AC82412-911B-4FA2-A013-EDC5E3F3FCC2}.Debug|x64.ActiveCfg = Debug|x64
     145    {5AC82412-911B-4FA2-A013-EDC5E3F3FCC2}.Debug|x64.Build.0 = Debug|x64
     146    {5AC82412-911B-4FA2-A013-EDC5E3F3FCC2}.Debug|x86.ActiveCfg = Debug|x86
     147    {5AC82412-911B-4FA2-A013-EDC5E3F3FCC2}.Debug|x86.Build.0 = Debug|x86
     148    {5AC82412-911B-4FA2-A013-EDC5E3F3FCC2}.Release|Any CPU.ActiveCfg = Release|Any CPU
     149    {5AC82412-911B-4FA2-A013-EDC5E3F3FCC2}.Release|Any CPU.Build.0 = Release|Any CPU
     150    {5AC82412-911B-4FA2-A013-EDC5E3F3FCC2}.Release|Mixed Platforms.ActiveCfg = Release|x86
     151    {5AC82412-911B-4FA2-A013-EDC5E3F3FCC2}.Release|Mixed Platforms.Build.0 = Release|x86
     152    {5AC82412-911B-4FA2-A013-EDC5E3F3FCC2}.Release|x64.ActiveCfg = Release|x64
     153    {5AC82412-911B-4FA2-A013-EDC5E3F3FCC2}.Release|x64.Build.0 = Release|x64
     154    {5AC82412-911B-4FA2-A013-EDC5E3F3FCC2}.Release|x86.ActiveCfg = Release|x86
     155    {5AC82412-911B-4FA2-A013-EDC5E3F3FCC2}.Release|x86.Build.0 = Release|x86
     156    {05BAE4E1-A9FA-4644-AA77-42558720159E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
     157    {05BAE4E1-A9FA-4644-AA77-42558720159E}.Debug|Any CPU.Build.0 = Debug|Any CPU
     158    {05BAE4E1-A9FA-4644-AA77-42558720159E}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
     159    {05BAE4E1-A9FA-4644-AA77-42558720159E}.Debug|Mixed Platforms.Build.0 = Debug|x86
     160    {05BAE4E1-A9FA-4644-AA77-42558720159E}.Debug|x64.ActiveCfg = Debug|x64
     161    {05BAE4E1-A9FA-4644-AA77-42558720159E}.Debug|x64.Build.0 = Debug|x64
     162    {05BAE4E1-A9FA-4644-AA77-42558720159E}.Debug|x86.ActiveCfg = Debug|x86
     163    {05BAE4E1-A9FA-4644-AA77-42558720159E}.Debug|x86.Build.0 = Debug|x86
     164    {05BAE4E1-A9FA-4644-AA77-42558720159E}.Release|Any CPU.ActiveCfg = Release|Any CPU
     165    {05BAE4E1-A9FA-4644-AA77-42558720159E}.Release|Any CPU.Build.0 = Release|Any CPU
     166    {05BAE4E1-A9FA-4644-AA77-42558720159E}.Release|Mixed Platforms.ActiveCfg = Release|x86
     167    {05BAE4E1-A9FA-4644-AA77-42558720159E}.Release|Mixed Platforms.Build.0 = Release|x86
     168    {05BAE4E1-A9FA-4644-AA77-42558720159E}.Release|x64.ActiveCfg = Release|x64
     169    {05BAE4E1-A9FA-4644-AA77-42558720159E}.Release|x64.Build.0 = Release|x64
     170    {05BAE4E1-A9FA-4644-AA77-42558720159E}.Release|x86.ActiveCfg = Release|x86
     171    {05BAE4E1-A9FA-4644-AA77-42558720159E}.Release|x86.Build.0 = Release|x86
    136172  EndGlobalSection
    137173  GlobalSection(SolutionProperties) = preSolution
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis

  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4.csproj

    r7734 r7750  
    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>
     
    9393  </PropertyGroup>
    9494  <ItemGroup>
    95     <Reference Include="ALGLIB-3.5.0, Version=3.5.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    96       <HintPath>..\..\bin\ALGLIB-3.5.0.dll</HintPath>
    97       <Private>False</Private>
     95    <Reference Include="ALGLIB-3.5.0">
     96      <HintPath>..\..\..\..\trunk\sources\bin\ALGLIB-3.5.0.dll</HintPath>
     97    </Reference>
     98    <Reference Include="HeuristicLab.Analysis-3.3">
     99      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Analysis-3.3.dll</HintPath>
     100    </Reference>
     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.Core-3.3">
     108      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath>
     109    </Reference>
     110    <Reference Include="HeuristicLab.Data-3.3">
     111      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath>
     112    </Reference>
     113    <Reference Include="HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4">
     114      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.dll</HintPath>
     115    </Reference>
     116    <Reference Include="HeuristicLab.Operators-3.3">
     117      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Operators-3.3.dll</HintPath>
     118    </Reference>
     119    <Reference Include="HeuristicLab.Optimization-3.3">
     120      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
     121    </Reference>
     122    <Reference Include="HeuristicLab.Parameters-3.3">
     123      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Parameters-3.3.dll</HintPath>
     124    </Reference>
     125    <Reference Include="HeuristicLab.Persistence-3.3">
     126      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Persistence-3.3.dll</HintPath>
     127    </Reference>
     128    <Reference Include="HeuristicLab.PluginInfrastructure-3.3">
     129      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
     130    </Reference>
     131    <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic-3.4">
     132      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.dll</HintPath>
    98133    </Reference>
    99134    <Reference Include="System" />
     
    149184  </ItemGroup>
    150185  <ItemGroup>
    151     <ProjectReference Include="..\..\HeuristicLab.Analysis\3.3\HeuristicLab.Analysis-3.3.csproj">
    152       <Project>{887425B4-4348-49ED-A457-B7D2C26DDBF9}</Project>
    153       <Name>HeuristicLab.Analysis-3.3</Name>
    154       <Private>False</Private>
    155     </ProjectReference>
    156     <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj">
    157       <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project>
    158       <Name>HeuristicLab.Collections-3.3</Name>
    159       <Private>False</Private>
    160     </ProjectReference>
    161     <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">
    162       <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project>
    163       <Name>HeuristicLab.Common-3.3</Name>
    164       <Private>False</Private>
    165     </ProjectReference>
    166     <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj">
    167       <Project>{C36BD924-A541-4A00-AFA8-41701378DDC5}</Project>
    168       <Name>HeuristicLab.Core-3.3</Name>
    169       <Private>False</Private>
    170     </ProjectReference>
    171     <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj">
    172       <Project>{BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}</Project>
    173       <Name>HeuristicLab.Data-3.3</Name>
    174       <Private>False</Private>
    175     </ProjectReference>
    176     <ProjectReference Include="..\..\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding\3.4\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj">
    177       <Project>{06D4A186-9319-48A0-BADE-A2058D462EEA}</Project>
    178       <Name>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4</Name>
    179       <Private>False</Private>
    180     </ProjectReference>
    181     <ProjectReference Include="..\..\HeuristicLab.Operators\3.3\HeuristicLab.Operators-3.3.csproj">
    182       <Project>{23DA7FF4-D5B8-41B6-AA96-F0561D24F3EE}</Project>
    183       <Name>HeuristicLab.Operators-3.3</Name>
    184       <Private>False</Private>
    185     </ProjectReference>
    186     <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj">
    187       <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project>
    188       <Name>HeuristicLab.Optimization-3.3</Name>
    189       <Private>False</Private>
    190     </ProjectReference>
    191     <ProjectReference Include="..\..\HeuristicLab.Parameters\3.3\HeuristicLab.Parameters-3.3.csproj">
    192       <Project>{56F9106A-079F-4C61-92F6-86A84C2D84B7}</Project>
    193       <Name>HeuristicLab.Parameters-3.3</Name>
    194       <Private>False</Private>
    195     </ProjectReference>
    196     <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj">
    197       <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project>
    198       <Name>HeuristicLab.Persistence-3.3</Name>
    199       <Private>False</Private>
    200     </ProjectReference>
    201     <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj">
    202       <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
    203       <Name>HeuristicLab.PluginInfrastructure-3.3</Name>
    204       <Private>False</Private>
    205     </ProjectReference>
    206     <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj">
    207       <Project>{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}</Project>
    208       <Name>HeuristicLab.Problems.DataAnalysis.Symbolic-3.4</Name>
    209       <Private>False</Private>
    210     </ProjectReference>
    211186    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis\3.4\HeuristicLab.Problems.DataAnalysis-3.4.csproj">
    212187      <Project>{DF87C13E-A889-46FF-8153-66DCAA8C5674}</Project>
    213188      <Name>HeuristicLab.Problems.DataAnalysis-3.4</Name>
    214189      <Private>False</Private>
     190    </ProjectReference>
     191    <ProjectReference Include="..\..\HeuristicLab.Problems.Instances\3.3\HeuristicLab.Problems.Instances-3.3.csproj">
     192      <Project>{3540E29E-4793-49E7-8EE2-FEA7F61C3994}</Project>
     193      <Name>HeuristicLab.Problems.Instances-3.3</Name>
    215194    </ProjectReference>
    216195  </ItemGroup>
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveProblem.cs

    r7734 r7750  
    1919 */
    2020#endregion
     21using System;
     22using System.Collections.Generic;
    2123using System.Linq;
    2224using HeuristicLab.Common;
     
    2426using HeuristicLab.Parameters;
    2527using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     28using HeuristicLab.Problems.Instances;
    2629
    2730namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification {
     
    2932  [StorableClass]
    3033  [Creatable("Problems")]
    31   public class SymbolicClassificationSingleObjectiveProblem : SymbolicDataAnalysisSingleObjectiveProblem<IClassificationProblemData, ISymbolicClassificationSingleObjectiveEvaluator, ISymbolicDataAnalysisSolutionCreator>, IClassificationProblem {
     34  public class SymbolicClassificationSingleObjectiveProblem : SymbolicDataAnalysisSingleObjectiveProblem<IClassificationProblemData, ISymbolicClassificationSingleObjectiveEvaluator, ISymbolicDataAnalysisSolutionCreator>, IClassificationProblem,
     35    IProblemInstanceConsumer<ClassificationData>, IProblemInstanceExporter<ClassificationData> {
    3236    private const double PunishmentFactor = 10;
    3337    private const int InitialMaximumTreeDepth = 8;
     
    113117      ProblemData = problemData;
    114118    }
     119
     120    public void Load(ClassificationData data) {
     121      Name = data.Name;
     122      Description = data.Description;
     123      Dataset dataset = new Dataset(data.InputVariables, data.Values);
     124      ProblemData = new ClassificationProblemData(dataset, data.AllowedInputVariables, data.TargetVariable);
     125      ProblemData.TrainingPartition.Start = data.TrainingPartitionStart;
     126      ProblemData.TrainingPartition.End = data.TrainingPartitionEnd;
     127      ProblemData.TestPartition.Start = data.TestPartitionStart;
     128      ProblemData.TestPartition.End = data.TestPartitionEnd;
     129      OnReset();
     130    }
     131
     132    public ClassificationData Export() {
     133      if (!ProblemData.InputVariables.Count.Equals(ProblemData.Dataset.DoubleVariables.Count()))
     134        throw new ArgumentException("Not all input variables are double variables! (Export only works with double variables)");
     135
     136      ClassificationData claData = new ClassificationData();
     137      claData.Name = Name;
     138      claData.Description = Description;
     139      claData.TargetVariable = ProblemData.TargetVariable;
     140      claData.InputVariables = ProblemData.InputVariables.Select(x => x.Value).ToArray();
     141      claData.AllowedInputVariables = ProblemData.AllowedInputVariables.ToArray();
     142      claData.TrainingPartitionStart = ProblemData.TrainingPartition.Start;
     143      claData.TrainingPartitionEnd = ProblemData.TrainingPartition.End;
     144      claData.TestPartitionStart = ProblemData.TestPartition.Start;
     145      claData.TestPartitionEnd = ProblemData.TestPartition.End;
     146
     147      List<List<double>> data = new List<List<double>>();
     148      foreach (var variable in ProblemData.Dataset.DoubleVariables) {
     149        data.Add(ProblemData.Dataset.GetDoubleValues(variable).ToList());
     150      }
     151      claData.Values = Transformer.Transformation(data);
     152
     153      return claData;
     154    }
    115155  }
    116156}
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.csproj

    r7734 r7750  
    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>
     
    9393  </PropertyGroup>
    9494  <ItemGroup>
    95     <Reference Include="ALGLIB-3.5.0, Version=3.5.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    96       <HintPath>..\..\bin\ALGLIB-3.5.0.dll</HintPath>
    97       <Private>False</Private>
     95    <Reference Include="ALGLIB-3.5.0">
     96      <HintPath>..\..\..\..\trunk\sources\bin\ALGLIB-3.5.0.dll</HintPath>
     97    </Reference>
     98    <Reference Include="HeuristicLab.Analysis-3.3">
     99      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Analysis-3.3.dll</HintPath>
     100    </Reference>
     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.Core-3.3">
     108      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath>
     109    </Reference>
     110    <Reference Include="HeuristicLab.Data-3.3">
     111      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath>
     112    </Reference>
     113    <Reference Include="HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4">
     114      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.dll</HintPath>
     115    </Reference>
     116    <Reference Include="HeuristicLab.Operators-3.3">
     117      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Operators-3.3.dll</HintPath>
     118    </Reference>
     119    <Reference Include="HeuristicLab.Optimization-3.3">
     120      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
     121    </Reference>
     122    <Reference Include="HeuristicLab.Parameters-3.3">
     123      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Parameters-3.3.dll</HintPath>
     124    </Reference>
     125    <Reference Include="HeuristicLab.Persistence-3.3">
     126      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Persistence-3.3.dll</HintPath>
     127    </Reference>
     128    <Reference Include="HeuristicLab.PluginInfrastructure-3.3">
     129      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
     130    </Reference>
     131    <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic-3.4">
     132      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.dll</HintPath>
    98133    </Reference>
    99134    <Reference Include="System" />
     
    144179  </ItemGroup>
    145180  <ItemGroup>
    146     <ProjectReference Include="..\..\HeuristicLab.Analysis\3.3\HeuristicLab.Analysis-3.3.csproj">
    147       <Project>{887425B4-4348-49ED-A457-B7D2C26DDBF9}</Project>
    148       <Name>HeuristicLab.Analysis-3.3</Name>
    149       <Private>False</Private>
    150     </ProjectReference>
    151     <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj">
    152       <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project>
    153       <Name>HeuristicLab.Collections-3.3</Name>
    154       <Private>False</Private>
    155     </ProjectReference>
    156     <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">
    157       <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project>
    158       <Name>HeuristicLab.Common-3.3</Name>
    159       <Private>False</Private>
    160     </ProjectReference>
    161     <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj">
    162       <Project>{C36BD924-A541-4A00-AFA8-41701378DDC5}</Project>
    163       <Name>HeuristicLab.Core-3.3</Name>
    164       <Private>False</Private>
    165     </ProjectReference>
    166     <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj">
    167       <Project>{BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}</Project>
    168       <Name>HeuristicLab.Data-3.3</Name>
    169       <Private>False</Private>
    170     </ProjectReference>
    171     <ProjectReference Include="..\..\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding\3.4\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj">
    172       <Project>{06D4A186-9319-48A0-BADE-A2058D462EEA}</Project>
    173       <Name>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4</Name>
    174       <Private>False</Private>
    175     </ProjectReference>
    176     <ProjectReference Include="..\..\HeuristicLab.Operators\3.3\HeuristicLab.Operators-3.3.csproj">
    177       <Project>{23DA7FF4-D5B8-41B6-AA96-F0561D24F3EE}</Project>
    178       <Name>HeuristicLab.Operators-3.3</Name>
    179       <Private>False</Private>
    180     </ProjectReference>
    181     <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj">
    182       <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project>
    183       <Name>HeuristicLab.Optimization-3.3</Name>
    184       <Private>False</Private>
    185     </ProjectReference>
    186     <ProjectReference Include="..\..\HeuristicLab.Parameters\3.3\HeuristicLab.Parameters-3.3.csproj">
    187       <Project>{56F9106A-079F-4C61-92F6-86A84C2D84B7}</Project>
    188       <Name>HeuristicLab.Parameters-3.3</Name>
    189       <Private>False</Private>
    190     </ProjectReference>
    191     <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj">
    192       <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project>
    193       <Name>HeuristicLab.Persistence-3.3</Name>
    194       <Private>False</Private>
    195     </ProjectReference>
    196     <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj">
    197       <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
    198       <Name>HeuristicLab.PluginInfrastructure-3.3</Name>
    199       <Private>False</Private>
    200     </ProjectReference>
    201     <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj">
    202       <Project>{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}</Project>
    203       <Name>HeuristicLab.Problems.DataAnalysis.Symbolic-3.4</Name>
    204       <Private>False</Private>
    205     </ProjectReference>
    206181    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis\3.4\HeuristicLab.Problems.DataAnalysis-3.4.csproj">
    207182      <Project>{DF87C13E-A889-46FF-8153-66DCAA8C5674}</Project>
    208183      <Name>HeuristicLab.Problems.DataAnalysis-3.4</Name>
    209184      <Private>False</Private>
     185    </ProjectReference>
     186    <ProjectReference Include="..\..\HeuristicLab.Problems.Instances\3.3\HeuristicLab.Problems.Instances-3.3.csproj">
     187      <Project>{3540E29E-4793-49E7-8EE2-FEA7F61C3994}</Project>
     188      <Name>HeuristicLab.Problems.Instances-3.3</Name>
    210189    </ProjectReference>
    211190  </ItemGroup>
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveProblem.cs

    r7734 r7750  
    2020#endregion
    2121
     22using System;
     23using System.Collections.Generic;
    2224using System.Linq;
    2325using HeuristicLab.Common;
     
    2527using HeuristicLab.Parameters;
    2628using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     29using HeuristicLab.Problems.Instances;
    2730
    2831namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression {
     
    3033  [StorableClass]
    3134  [Creatable("Problems")]
    32   public class SymbolicRegressionSingleObjectiveProblem : SymbolicDataAnalysisSingleObjectiveProblem<IRegressionProblemData, ISymbolicRegressionSingleObjectiveEvaluator, ISymbolicDataAnalysisSolutionCreator>, IRegressionProblem {
     35  public class SymbolicRegressionSingleObjectiveProblem : SymbolicDataAnalysisSingleObjectiveProblem<IRegressionProblemData, ISymbolicRegressionSingleObjectiveEvaluator, ISymbolicDataAnalysisSolutionCreator>, IRegressionProblem,
     36    IProblemInstanceConsumer<RegressionData>, IProblemInstanceExporter<RegressionData> {
    3337    private const double PunishmentFactor = 10;
    3438    private const int InitialMaximumTreeDepth = 8;
     
    116120      ProblemData = problemData;
    117121    }
     122
     123    public void Load(RegressionData data) {
     124      Name = data.Name;
     125      Description = data.Description;
     126      Dataset dataset = new Dataset(data.InputVariables, data.Values);
     127      ProblemData = new RegressionProblemData(dataset, data.AllowedInputVariables, data.TargetVariable);
     128      ProblemData.TrainingPartition.Start = data.TrainingPartitionStart;
     129      ProblemData.TrainingPartition.End = data.TrainingPartitionEnd;
     130      ProblemData.TestPartition.Start = data.TestPartitionStart;
     131      ProblemData.TestPartition.End = data.TestPartitionEnd;
     132      OnReset();
     133    }
     134
     135    public RegressionData Export() {
     136      if (!ProblemData.InputVariables.Count.Equals(ProblemData.Dataset.DoubleVariables.Count()))
     137        throw new ArgumentException("Not all input variables are double variables! (Export only works with double variables)");
     138
     139      RegressionData regData = new RegressionData();
     140      regData.Name = Name;
     141      regData.Description = Description;
     142      regData.TargetVariable = ProblemData.TargetVariable;
     143      regData.InputVariables = ProblemData.InputVariables.Select(x => x.Value).ToArray();
     144      regData.AllowedInputVariables = ProblemData.AllowedInputVariables.ToArray();
     145      regData.TrainingPartitionStart = ProblemData.TrainingPartition.Start;
     146      regData.TrainingPartitionEnd = ProblemData.TrainingPartition.End;
     147      regData.TestPartitionStart = ProblemData.TestPartition.Start;
     148      regData.TestPartitionEnd = ProblemData.TestPartition.End;
     149
     150      List<List<double>> data = new List<List<double>>();
     151      foreach (var variable in ProblemData.Dataset.DoubleVariables) {
     152        data.Add(ProblemData.Dataset.GetDoubleValues(variable).ToList());
     153      }
     154      regData.Values = Transformer.Transformation(data);
     155
     156      return regData;
     157    }
    118158  }
    119159}
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis/3.4/Dataset.cs

    r7259 r7750  
    7272      rows = variableValues.First().Count;
    7373      this.variableNames = new List<string>(variableNames);
    74       this.variableValues = new Dictionary<string, IList>();
     74      this.variableValues = new Dictionary<string, IList>(this.variableNames.Count);
    7575      for (int i = 0; i < this.variableNames.Count; i++) {
    7676        var values = variableValues.ElementAt(i);
     
    107107      this.variableNames = new List<string>(variableNames);
    108108
    109       this.variableValues = new Dictionary<string, IList>();
     109      this.variableValues = new Dictionary<string, IList>(variableValues.GetLength(1));
    110110      for (int col = 0; col < variableValues.GetLength(1); col++) {
    111111        string columName = this.variableNames[col];
    112         var values = new List<double>();
     112        var values = new List<double>(variableValues.GetLength(0));
    113113        for (int row = 0; row < variableValues.GetLength(0); row++) {
    114114          values.Add(variableValues[row, col]);
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj

    r7687 r7750  
    177177    <Compile Include="Interfaces\Regression\IRegressionEnsembleSolution.cs" />
    178178    <Compile Include="Implementation\Regression\RegressionSolutionBase.cs" />
     179    <Compile Include="OnlineCalculators\OnlineMaxAbsoluteErrorCalculator.cs" />
    179180    <Compile Include="OnlineCalculators\OnlineMeanErrorCalculator.cs" />
    180181    <Compile Include="OnlineCalculators\NormalizedGiniCalculator.cs" />
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblem.cs

    r7683 r7750  
    3333  [Creatable("Problems")]
    3434  public class ClassificationProblem : DataAnalysisProblem<IClassificationProblemData>, IClassificationProblem, IStorableContent,
    35     IProblemInstanceConsumer<ClassificationData>, IProblemInstanceExporter<ClassificationData>, IProblemInstanceConsumer, IProblemInstanceExporter {
     35    IProblemInstanceConsumer<ClassificationData>, IProblemInstanceExporter<ClassificationData> {
    3636    public string Filename { get; set; }
    3737
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleSolution.cs

    r7259 r7750  
    9797
    9898      RegisterRegressionSolutionsEventHandler();
     99    }
     100
     101    public RegressionEnsembleSolution(IRegressionProblemData problemData)
     102      : this(Enumerable.Empty<IRegressionModel>(), problemData) {
    99103    }
    100104
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolution.cs

    r7259 r7750  
    4444    protected RegressionSolution(IRegressionModel model, IRegressionProblemData problemData)
    4545      : base(model, problemData) {
    46       evaluationCache = new Dictionary<int, double>();
     46      evaluationCache = new Dictionary<int, double>(problemData.Dataset.Rows);
    4747    }
    4848
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolutionBase.cs

    r7272 r7750  
    2121
    2222using System.Collections.Generic;
    23 using System.Linq;
    2423using HeuristicLab.Common;
    2524using HeuristicLab.Data;
     
    166165
    167166    protected void CalculateResults() {
    168       double[] estimatedTrainingValues = EstimatedTrainingValues.ToArray(); // cache values
    169       double[] originalTrainingValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes).ToArray();
    170       double[] estimatedTestValues = EstimatedTestValues.ToArray(); // cache values
    171       double[] originalTestValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TestIndizes).ToArray();
     167      IEnumerable<double> estimatedTrainingValues = EstimatedTrainingValues; // cache values
     168      IEnumerable<double> originalTrainingValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes);
     169      IEnumerable<double> estimatedTestValues = EstimatedTestValues; // cache values
     170      IEnumerable<double> originalTestValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TestIndizes);
    172171
    173172      OnlineCalculatorError errorState;
Note: See TracChangeset for help on using the changeset viewer.