Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/30/13 16:54:43 (11 years ago)
Author:
sforsten
Message:

#1980:

  • added multiple discretizer to GAssist
  • created ensembles for LCS problems and edited CrossValidation to use them
Location:
branches/LearningClassifierSystems/HeuristicLab.Algorithms.DataAnalysis/3.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/LearningClassifierSystems/HeuristicLab.Algorithms.DataAnalysis/3.4/CrossValidation.cs

    r8970 r9411  
    2929using HeuristicLab.Core;
    3030using HeuristicLab.Data;
     31using HeuristicLab.Encodings.ConditionActionEncoding;
    3132using HeuristicLab.Optimization;
     33using HeuristicLab.Optimization.Operators.LCS;
    3234using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3335using HeuristicLab.Problems.DataAnalysis;
     
    405407        results.Add(result.Name, result.Value);
    406408      }
     409      foreach (IResult result in ExtractAndAggregateGAssistSolutions(resultCollections)) {
     410        results.Add(result.Name, result.Value);
     411      }
     412      foreach (IResult result in ExtractAndAggregateConditionActionSolutions(resultCollections)) {
     413        results.Add(result.Name, result.Value);
     414      }
    407415      results.Add("Execution Time", new TimeSpanValue(this.ExecutionTime));
    408416      results.Add("CrossValidation Folds", new RunCollection(runs));
     417    }
     418
     419    private IEnumerable<IResult> ExtractAndAggregateConditionActionSolutions(IEnumerable<KeyValuePair<string, IItem>> resultCollections) {
     420      Dictionary<string, List<IConditionActionSolution>> resultSolutions = new Dictionary<string, List<IConditionActionSolution>>();
     421      foreach (var result in resultCollections) {
     422        var conditionActionSolution = result.Value as IConditionActionSolution;
     423        if (conditionActionSolution != null) {
     424          if (resultSolutions.ContainsKey(result.Key)) {
     425            resultSolutions[result.Key].Add(conditionActionSolution);
     426          } else {
     427            resultSolutions.Add(result.Key, new List<IConditionActionSolution>() { conditionActionSolution });
     428          }
     429        }
     430      }
     431      List<IResult> aggregatedResults = new List<IResult>();
     432      foreach (KeyValuePair<string, List<IConditionActionSolution>> solutions in resultSolutions) {
     433        // clone manually to correctly clone references between cloned root objects
     434        Cloner cloner = new Cloner();
     435        var problemDataClone = (IConditionActionProblemData)cloner.Clone(Problem.ProblemData);
     436        // set partitions of problem data clone correctly
     437        problemDataClone.TrainingPartition.Start = SamplesStart.Value; problemDataClone.TrainingPartition.End = SamplesEnd.Value;
     438        problemDataClone.TestPartition.Start = SamplesStart.Value; problemDataClone.TestPartition.End = SamplesEnd.Value;
     439        // clone models
     440        var ensembleSolution = new ConditionActionEnsembleSolution(problemDataClone);
     441        ensembleSolution.AddConditionActionSolutions(solutions.Value);
     442
     443        aggregatedResults.Add(new Result(solutions.Key + " (ensemble)", ensembleSolution));
     444      }
     445      List<IResult> flattenedResults = new List<IResult>();
     446      CollectResultsRecursively("", aggregatedResults, flattenedResults);
     447      return flattenedResults;
     448    }
     449
     450    private IEnumerable<IResult> ExtractAndAggregateGAssistSolutions(IEnumerable<KeyValuePair<string, IItem>> resultCollections) {
     451      Dictionary<string, List<IGAssistSolution>> resultSolutions = new Dictionary<string, List<IGAssistSolution>>();
     452      foreach (var result in resultCollections) {
     453        var gassistSolution = result.Value as IGAssistSolution;
     454        if (gassistSolution != null) {
     455          if (resultSolutions.ContainsKey(result.Key)) {
     456            resultSolutions[result.Key].Add(gassistSolution);
     457          } else {
     458            resultSolutions.Add(result.Key, new List<IGAssistSolution>() { gassistSolution });
     459          }
     460        }
     461      }
     462      List<IResult> aggregatedResults = new List<IResult>();
     463      foreach (KeyValuePair<string, List<IGAssistSolution>> solutions in resultSolutions) {
     464        // clone manually to correctly clone references between cloned root objects
     465        Cloner cloner = new Cloner();
     466        var problemDataClone = (IGAssistProblemData)cloner.Clone(Problem.ProblemData);
     467        // set partitions of problem data clone correctly
     468        problemDataClone.TrainingPartition.Start = SamplesStart.Value; problemDataClone.TrainingPartition.End = SamplesEnd.Value;
     469        problemDataClone.TestPartition.Start = SamplesStart.Value; problemDataClone.TestPartition.End = SamplesEnd.Value;
     470        // clone models
     471        var ensembleSolution = new GAssistEnsembleSolution(problemDataClone);
     472        ensembleSolution.AddGAssistSolutions(solutions.Value);
     473
     474        aggregatedResults.Add(new Result(solutions.Key + " (ensemble)", ensembleSolution));
     475      }
     476      List<IResult> flattenedResults = new List<IResult>();
     477      CollectResultsRecursively("", aggregatedResults, flattenedResults);
     478      return flattenedResults;
    409479    }
    410480
  • branches/LearningClassifierSystems/HeuristicLab.Algorithms.DataAnalysis/3.4/HeuristicLab.Algorithms.DataAnalysis-3.4.csproj

    r9359 r9411  
    4343    <DebugType>full</DebugType>
    4444    <Optimize>false</Optimize>
    45     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     45    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
    4646    <DefineConstants>DEBUG;TRACE</DefineConstants>
    4747    <ErrorReport>prompt</ErrorReport>
     
    5252    <DebugType>pdbonly</DebugType>
    5353    <Optimize>true</Optimize>
    54     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     54    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
    5555    <DefineConstants>TRACE</DefineConstants>
    5656    <ErrorReport>prompt</ErrorReport>
     
    6262  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    6363    <DebugSymbols>true</DebugSymbols>
    64     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     64    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
    6565    <DefineConstants>DEBUG;TRACE</DefineConstants>
    6666    <DebugType>full</DebugType>
     
    7070  </PropertyGroup>
    7171  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    72     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     72    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
    7373    <DefineConstants>TRACE</DefineConstants>
    7474    <DocumentationFile>
     
    8282  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
    8383    <DebugSymbols>true</DebugSymbols>
    84     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     84    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
    8585    <DefineConstants>DEBUG;TRACE</DefineConstants>
    8686    <DebugType>full</DebugType>
     
    9090  </PropertyGroup>
    9191  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
    92     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     92    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
    9393    <DefineConstants>TRACE</DefineConstants>
    9494    <DocumentationFile>
     
    102102  <ItemGroup>
    103103    <Reference Include="ALGLIB-3.7.0, Version=3.7.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    104       <HintPath>..\..\bin\ALGLIB-3.7.0.dll</HintPath>
     104      <HintPath>..\..\..\..\trunk\sources\bin\ALGLIB-3.7.0.dll</HintPath>
    105105      <Private>False</Private>
    106106    </Reference>
    107107    <Reference Include="AutoDiff-1.0, Version=1.0.0.14388, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    108108      <SpecificVersion>False</SpecificVersion>
    109       <HintPath>..\..\bin\AutoDiff-1.0.dll</HintPath>
     109      <HintPath>..\..\..\..\trunk\sources\bin\AutoDiff-1.0.dll</HintPath>
     110    </Reference>
     111    <Reference Include="HeuristicLab.Algorithms.GradientDescent-3.3">
     112      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Algorithms.GradientDescent-3.3.dll</HintPath>
     113    </Reference>
     114    <Reference Include="HeuristicLab.Analysis-3.3">
     115      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Analysis-3.3.dll</HintPath>
     116    </Reference>
     117    <Reference Include="HeuristicLab.Collections-3.3">
     118      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Collections-3.3.dll</HintPath>
     119    </Reference>
     120    <Reference Include="HeuristicLab.Common-3.3">
     121      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath>
     122    </Reference>
     123    <Reference Include="HeuristicLab.Common.Resources-3.3">
     124      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common.Resources-3.3.dll</HintPath>
     125    </Reference>
     126    <Reference Include="HeuristicLab.Data-3.3">
     127      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath>
     128    </Reference>
     129    <Reference Include="HeuristicLab.Encodings.RealVectorEncoding-3.3">
     130      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Encodings.RealVectorEncoding-3.3.dll</HintPath>
     131    </Reference>
     132    <Reference Include="HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4">
     133      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.dll</HintPath>
     134    </Reference>
     135    <Reference Include="HeuristicLab.Operators-3.3">
     136      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Operators-3.3.dll</HintPath>
     137    </Reference>
     138    <Reference Include="HeuristicLab.Optimization-3.3">
     139      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
     140    </Reference>
     141    <Reference Include="HeuristicLab.Parameters-3.3">
     142      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Parameters-3.3.dll</HintPath>
     143    </Reference>
     144    <Reference Include="HeuristicLab.Persistence-3.3">
     145      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Persistence-3.3.dll</HintPath>
     146    </Reference>
     147    <Reference Include="HeuristicLab.PluginInfrastructure-3.3">
     148      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
     149    </Reference>
     150    <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic-3.4">
     151      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.dll</HintPath>
     152    </Reference>
     153    <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4">
     154      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4.dll</HintPath>
     155    </Reference>
     156    <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4">
     157      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.dll</HintPath>
     158    </Reference>
     159    <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis-3.4">
     160      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis-3.4.dll</HintPath>
     161    </Reference>
     162    <Reference Include="HeuristicLab.Problems.Instances-3.3">
     163      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.Instances-3.3.dll</HintPath>
     164    </Reference>
     165    <Reference Include="HeuristicLab.Random-3.3">
     166      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Random-3.3.dll</HintPath>
    110167    </Reference>
    111168    <Reference Include="LibSVM-3.12, Version=3.12.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    112       <HintPath>..\..\bin\LibSVM-3.12.dll</HintPath>
     169      <HintPath>..\..\..\..\trunk\sources\bin\LibSVM-3.12.dll</HintPath>
    113170      <Private>False</Private>
    114171    </Reference>
     
    278335  </ItemGroup>
    279336  <ItemGroup>
    280     <ProjectReference Include="..\..\HeuristicLab.Algorithms.GradientDescent\3.3\HeuristicLab.Algorithms.GradientDescent-3.3.csproj">
    281       <Project>{1256B945-EEA9-4BE4-9880-76B5B113F089}</Project>
    282       <Name>HeuristicLab.Algorithms.GradientDescent</Name>
    283       <Private>False</Private>
    284     </ProjectReference>
    285     <ProjectReference Include="..\..\HeuristicLab.Analysis\3.3\HeuristicLab.Analysis-3.3.csproj">
    286       <Project>{887425B4-4348-49ED-A457-B7D2C26DDBF9}</Project>
    287       <Name>HeuristicLab.Analysis-3.3</Name>
    288       <Private>False</Private>
    289     </ProjectReference>
    290     <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj">
    291       <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project>
    292       <Name>HeuristicLab.Collections-3.3</Name>
    293       <Private>False</Private>
    294     </ProjectReference>
    295     <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj">
    296       <Project>{0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}</Project>
    297       <Name>HeuristicLab.Common.Resources-3.3</Name>
    298       <Private>False</Private>
    299     </ProjectReference>
    300     <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">
    301       <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project>
    302       <Name>HeuristicLab.Common-3.3</Name>
    303       <Private>False</Private>
    304     </ProjectReference>
    305337    <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj">
    306338      <Project>{C36BD924-A541-4A00-AFA8-41701378DDC5}</Project>
     
    308340      <Private>False</Private>
    309341    </ProjectReference>
    310     <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj">
    311       <Project>{BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}</Project>
    312       <Name>HeuristicLab.Data-3.3</Name>
    313       <Private>False</Private>
     342    <ProjectReference Include="..\..\HeuristicLab.Encodings.ConditionActionEncoding\3.3\HeuristicLab.Encodings.ConditionActionEncoding-3.3.csproj">
     343      <Project>{422fb262-0845-4969-8d16-12f057aa90b1}</Project>
     344      <Name>HeuristicLab.Encodings.ConditionActionEncoding-3.3</Name>
    314345    </ProjectReference>
    315     <ProjectReference Include="..\..\HeuristicLab.Encodings.RealVectorEncoding\3.3\HeuristicLab.Encodings.RealVectorEncoding-3.3.csproj">
    316       <Project>{BB6D334A-4BB6-4674-9883-31A6EBB32CAB}</Project>
    317       <Name>HeuristicLab.Encodings.RealVectorEncoding-3.3</Name>
    318       <Private>False</Private>
    319     </ProjectReference>
    320     <ProjectReference Include="..\..\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding\3.4\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj">
    321       <Project>{06D4A186-9319-48A0-BADE-A2058D462EEA}</Project>
    322       <Name>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4</Name>
    323       <Private>False</Private>
    324     </ProjectReference>
    325     <ProjectReference Include="..\..\HeuristicLab.Operators\3.3\HeuristicLab.Operators-3.3.csproj">
    326       <Project>{23DA7FF4-D5B8-41B6-AA96-F0561D24F3EE}</Project>
    327       <Name>HeuristicLab.Operators-3.3</Name>
    328       <Private>False</Private>
    329     </ProjectReference>
    330     <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj">
    331       <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project>
    332       <Name>HeuristicLab.Optimization-3.3</Name>
    333       <Private>False</Private>
    334     </ProjectReference>
    335     <ProjectReference Include="..\..\HeuristicLab.Parameters\3.3\HeuristicLab.Parameters-3.3.csproj">
    336       <Project>{56F9106A-079F-4C61-92F6-86A84C2D84B7}</Project>
    337       <Name>HeuristicLab.Parameters-3.3</Name>
    338       <Private>False</Private>
    339     </ProjectReference>
    340     <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj">
    341       <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project>
    342       <Name>HeuristicLab.Persistence-3.3</Name>
    343       <Private>False</Private>
    344     </ProjectReference>
    345     <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj">
    346       <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
    347       <Name>HeuristicLab.PluginInfrastructure-3.3</Name>
    348       <Private>False</Private>
    349     </ProjectReference>
    350     <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic.Classification\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4.csproj">
    351       <Project>{05BAE4E1-A9FA-4644-AA77-42558720159E}</Project>
    352       <Name>HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4</Name>
    353       <Private>False</Private>
    354     </ProjectReference>
    355     <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic.Regression\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.csproj">
    356       <Project>{5AC82412-911B-4FA2-A013-EDC5E3F3FCC2}</Project>
    357       <Name>HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4</Name>
    358       <Private>False</Private>
    359     </ProjectReference>
    360     <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis-3.4.csproj">
    361       <Project>{07486E68-1517-4B9D-A58D-A38E99AE71AB}</Project>
    362       <Name>HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis-3.4</Name>
    363     </ProjectReference>
    364     <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj">
    365       <Project>{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}</Project>
    366       <Name>HeuristicLab.Problems.DataAnalysis.Symbolic-3.4</Name>
    367       <Private>False</Private>
     346    <ProjectReference Include="..\..\HeuristicLab.Optimization.Operators.LCS\3.3\HeuristicLab.Optimization.Operators.LCS-3.3.csproj">
     347      <Project>{f2c6d3b0-bd4f-4747-b13e-b18e53a2a09d}</Project>
     348      <Name>HeuristicLab.Optimization.Operators.LCS-3.3</Name>
    368349    </ProjectReference>
    369350    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis\3.4\HeuristicLab.Problems.DataAnalysis-3.4.csproj">
    370351      <Project>{DF87C13E-A889-46FF-8153-66DCAA8C5674}</Project>
    371352      <Name>HeuristicLab.Problems.DataAnalysis-3.4</Name>
    372       <Private>False</Private>
    373     </ProjectReference>
    374     <ProjectReference Include="..\..\HeuristicLab.Problems.Instances\3.3\HeuristicLab.Problems.Instances-3.3.csproj">
    375       <Project>{3540E29E-4793-49E7-8EE2-FEA7F61C3994}</Project>
    376       <Name>HeuristicLab.Problems.Instances-3.3</Name>
    377       <Private>False</Private>
    378     </ProjectReference>
    379     <ProjectReference Include="..\..\HeuristicLab.Random\3.3\HeuristicLab.Random-3.3.csproj">
    380       <Project>{F4539FB6-4708-40C9-BE64-0A1390AEA197}</Project>
    381       <Name>HeuristicLab.Random-3.3</Name>
    382353      <Private>False</Private>
    383354    </ProjectReference>
Note: See TracChangeset for help on using the changeset viewer.