Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/18/12 16:03:11 (12 years ago)
Author:
sforsten
Message:

#1292:

  • completed branch creation
  • first simple implementation of a HeatMap, which shows the correlation of the dataset features
Location:
branches/DatasetFeatureCorrelation
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/DatasetFeatureCorrelation

    • Property svn:ignore set to
      *.suo
  • branches/DatasetFeatureCorrelation/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj

    r7969 r8038  
    4141    <DebugType>full</DebugType>
    4242    <Optimize>false</Optimize>
    43     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     43    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
    4444    <DefineConstants>DEBUG;TRACE</DefineConstants>
    4545    <ErrorReport>prompt</ErrorReport>
     
    9393  </PropertyGroup>
    9494  <ItemGroup>
     95    <Reference Include="HeuristicLab.Analysis-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     96      <Private>False</Private>
     97    </Reference>
     98    <Reference Include="HeuristicLab.Collections-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     99      <Private>False</Private>
     100    </Reference>
     101    <Reference Include="HeuristicLab.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     102      <Private>False</Private>
     103    </Reference>
     104    <Reference Include="HeuristicLab.Common.Resources-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     105      <Private>False</Private>
     106    </Reference>
     107    <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     108      <Private>False</Private>
     109    </Reference>
     110    <Reference Include="HeuristicLab.Data-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     111      <Private>False</Private>
     112    </Reference>
     113    <Reference Include="HeuristicLab.Optimization-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     114      <Private>False</Private>
     115    </Reference>
     116    <Reference Include="HeuristicLab.Parameters-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     117      <Private>False</Private>
     118    </Reference>
     119    <Reference Include="HeuristicLab.Persistence-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     120      <Private>False</Private>
     121    </Reference>
     122    <Reference Include="HeuristicLab.PluginInfrastructure-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     123      <Private>False</Private>
     124    </Reference>
     125    <Reference Include="HeuristicLab.Problems.Instances-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     126      <Private>False</Private>
     127    </Reference>
    95128    <Reference Include="System" />
    96129    <Reference Include="System.Core">
     
    208241    </BootstrapperPackage>
    209242  </ItemGroup>
    210   <ItemGroup>
    211     <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj">
    212       <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project>
    213       <Name>HeuristicLab.Collections-3.3</Name>
    214       <Private>False</Private>
    215     </ProjectReference>
    216     <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj">
    217       <Project>{0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}</Project>
    218       <Name>HeuristicLab.Common.Resources-3.3</Name>
    219       <Private>False</Private>
    220     </ProjectReference>
    221     <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">
    222       <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project>
    223       <Name>HeuristicLab.Common-3.3</Name>
    224       <Private>False</Private>
    225     </ProjectReference>
    226     <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj">
    227       <Project>{C36BD924-A541-4A00-AFA8-41701378DDC5}</Project>
    228       <Name>HeuristicLab.Core-3.3</Name>
    229       <Private>False</Private>
    230     </ProjectReference>
    231     <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj">
    232       <Project>{BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}</Project>
    233       <Name>HeuristicLab.Data-3.3</Name>
    234       <Private>False</Private>
    235     </ProjectReference>
    236     <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj">
    237       <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project>
    238       <Name>HeuristicLab.Optimization-3.3</Name>
    239       <Private>False</Private>
    240     </ProjectReference>
    241     <ProjectReference Include="..\..\HeuristicLab.Parameters\3.3\HeuristicLab.Parameters-3.3.csproj">
    242       <Project>{56F9106A-079F-4C61-92F6-86A84C2D84B7}</Project>
    243       <Name>HeuristicLab.Parameters-3.3</Name>
    244       <Private>False</Private>
    245     </ProjectReference>
    246     <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj">
    247       <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project>
    248       <Name>HeuristicLab.Persistence-3.3</Name>
    249       <Private>False</Private>
    250     </ProjectReference>
    251     <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj">
    252       <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
    253       <Name>HeuristicLab.PluginInfrastructure-3.3</Name>
    254       <Private>False</Private>
    255     </ProjectReference>
    256     <ProjectReference Include="..\..\HeuristicLab.Problems.Instances\3.3\HeuristicLab.Problems.Instances-3.3.csproj">
    257       <Project>{3540E29E-4793-49E7-8EE2-FEA7F61C3994}</Project>
    258       <Name>HeuristicLab.Problems.Instances-3.3</Name>
    259       <Private>False</Private>
    260     </ProjectReference>
    261   </ItemGroup>
    262243  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    263244  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
  • branches/DatasetFeatureCorrelation/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblemData.cs

    r7265 r8038  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Analysis;
    2526using HeuristicLab.Collections;
    2627using HeuristicLab.Common;
     
    3738    protected const string TrainingPartitionParameterName = "TrainingPartition";
    3839    protected const string TestPartitionParameterName = "TestPartition";
     40    protected const string DatasetHeatMapParameterName = "DatasetCorrelationHeatMap";
    3941
    4042    #region parameter properites
     
    5052    public IFixedValueParameter<IntRange> TestPartitionParameter {
    5153      get { return (IFixedValueParameter<IntRange>)Parameters[TestPartitionParameterName]; }
     54    }
     55    public IFixedValueParameter<HeatMap> DatasetHeatMapParameter {
     56      get { return (IFixedValueParameter<HeatMap>)Parameters[DatasetHeatMapParameterName]; }
    5257    }
    5358    #endregion
     
    7378    public IntRange TestPartition {
    7479      get { return TestPartitionParameter.Value; }
     80    }
     81    public HeatMap DatasetHeatMap {
     82      get { return DatasetHeatMapParameter.Value; }
    7583    }
    7684
     
    132140      Parameters.Add(new FixedValueParameter<IntRange>(TrainingPartitionParameterName, "", new IntRange(trainingPartitionStart, trainingPartitionEnd)));
    133141      Parameters.Add(new FixedValueParameter<IntRange>(TestPartitionParameterName, "", new IntRange(testPartitionStart, testPartitionEnd)));
     142      Parameters.Add(new FixedValueParameter<HeatMap>(DatasetHeatMapParameterName, "", CalculateHeatMap(dataset)));
    134143
    135144      ((ValueParameter<Dataset>)DatasetParameter).ReactOnValueToStringChangedAndValueItemImageChanged = false;
    136145      RegisterEventHandlers();
     146    }
     147
     148    private HeatMap CalculateHeatMap(Dataset dataset) {
     149      IList<string> doubleVariableNames = dataset.DoubleVariables.ToList();
     150      OnlineCalculatorError error;
     151      int length = doubleVariableNames.Count;
     152      double[,] elements = new double[length, length];
     153
     154      for (int i = 0; i < length; i++) {
     155        for (int j = 0; j < i + 1; j++) {
     156          elements[i, j] = OnlinePearsonsRSquaredCalculator.Calculate(dataset.GetDoubleValues(doubleVariableNames[length - 1 - i]), dataset.GetDoubleValues(doubleVariableNames[j]), out error);
     157          elements[j, i] = elements[i, j];
     158          if (!error.Equals(OnlineCalculatorError.None)) {
     159            throw new ArgumentException("Calculator returned " + error);
     160          }
     161        }
     162      }
     163      return new HeatMap(elements, "Hoeffdings Dependence");
    137164    }
    138165
  • branches/DatasetFeatureCorrelation/HeuristicLab.Problems.DataAnalysis/3.4/Plugin.cs.frame

    r7823 r8038  
    2828  [Plugin("HeuristicLab.Problems.DataAnalysis","Provides base classes for data analysis tasks.", "3.4.2.$WCREV$")]
    2929  [PluginFile("HeuristicLab.Problems.DataAnalysis-3.4.dll", PluginFileType.Assembly)]
     30  [PluginDependency("HeuristicLab.Analysis", "3.3")]
    3031  [PluginDependency("HeuristicLab.Collections", "3.3")]
    3132  [PluginDependency("HeuristicLab.Common", "3.3")]
Note: See TracChangeset for help on using the changeset viewer.