Changeset 8542


Ignore:
Timestamp:
08/30/12 11:47:47 (7 years ago)
Author:
mkommend
Message:

#1292: Integrated correlation analysis of datasets in the trunk.

Location:
trunk/sources
Files:
2 added
5 edited
6 copied

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelationView.Designer.cs

    r8538 r8542  
    1 namespace HeuristicLab.Problems.DataAnalysis.Views {
     1#region License Information
     2
     3/* HeuristicLab
     4 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     5 *
     6 * This file is part of HeuristicLab.
     7 *
     8 * HeuristicLab is free software: you can redistribute it and/or modify
     9 * it under the terms of the GNU General Public License as published by
     10 * the Free Software Foundation, either version 3 of the License, or
     11 * (at your option) any later version.
     12 *
     13 * HeuristicLab is distributed in the hope that it will be useful,
     14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     16 * GNU General Public License for more details.
     17 *
     18 * You should have received a copy of the GNU General Public License
     19 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     20 */
     21
     22#endregion
     23namespace HeuristicLab.Problems.DataAnalysis.Views {
    224  partial class FeatureCorrelationView {
    325    /// <summary>
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj

    r8435 r8542  
    138138      <DependentUpon>DataAnalysisSolutionEvaluationView.cs</DependentUpon>
    139139    </Compile>
     140    <Compile Include="FeatureCorrelationView.cs">
     141      <SubType>UserControl</SubType>
     142    </Compile>
     143    <Compile Include="FeatureCorrelationView.Designer.cs">
     144      <DependentUpon>FeatureCorrelationView.cs</DependentUpon>
     145    </Compile>
    140146    <Compile Include="Plugin.cs" />
    141147    <Compile Include="Regression\RegressionEnsembleSolutionModelView.cs">
     
    266272    <Compile Include="Solution Views\RegressionSolutionView.Designer.cs">
    267273      <DependentUpon>RegressionSolutionView.cs</DependentUpon>
     274    </Compile>
     275    <Compile Include="TimeframeFeatureCorrelationView.cs">
     276      <SubType>UserControl</SubType>
     277    </Compile>
     278    <Compile Include="TimeframeFeatureCorrelationView.Designer.cs">
     279      <DependentUpon>TimeframeFeatureCorrelationView.cs</DependentUpon>
    268280    </Compile>
    269281    <None Include="HeuristicLab.snk" />
     
    388400  <ItemGroup>
    389401    <Folder Include="obj\" />
     402  </ItemGroup>
     403  <ItemGroup>
     404    <EmbeddedResource Include="FeatureCorrelationView.resx">
     405      <DependentUpon>FeatureCorrelationView.cs</DependentUpon>
     406    </EmbeddedResource>
     407    <EmbeddedResource Include="TimeframeFeatureCorrelationView.resx">
     408      <DependentUpon>TimeframeFeatureCorrelationView.cs</DependentUpon>
     409    </EmbeddedResource>
    390410  </ItemGroup>
    391411  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/TimeframeFeatureCorrelationView.Designer.cs

    r8538 r8542  
    1 namespace HeuristicLab.Problems.DataAnalysis.Views {
     1#region License Information
     2
     3/* HeuristicLab
     4 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     5 *
     6 * This file is part of HeuristicLab.
     7 *
     8 * HeuristicLab is free software: you can redistribute it and/or modify
     9 * it under the terms of the GNU General Public License as published by
     10 * the Free Software Foundation, either version 3 of the License, or
     11 * (at your option) any later version.
     12 *
     13 * HeuristicLab is distributed in the hope that it will be useful,
     14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     16 * GNU General Public License for more details.
     17 *
     18 * You should have received a copy of the GNU General Public License
     19 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     20 */
     21
     22#endregion
     23namespace HeuristicLab.Problems.DataAnalysis.Views {
    224  partial class TimeframeFeatureCorrelationView {
    325    /// <summary>
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj

    r7969 r8542  
    9393  </PropertyGroup>
    9494  <ItemGroup>
     95    <Reference Include="ALGLIB-3.6.0, Version=3.6.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     96      <HintPath>..\..\bin\ALGLIB-3.6.0.dll</HintPath>
     97    </Reference>
     98    <Reference Include="HeuristicLab.ALGLIB-3.6.0, Version=3.6.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     99      <HintPath>..\..\bin\HeuristicLab.ALGLIB-3.6.0.dll</HintPath>
     100    </Reference>
    95101    <Reference Include="System" />
    96102    <Reference Include="System.Core">
     
    122128    <Compile Include="Implementation\Clustering\ClusteringProblemData.cs" />
    123129    <Compile Include="Implementation\Clustering\ClusteringSolution.cs" />
     130    <Compile Include="Implementation\FeatureCorrelation.cs" />
    124131    <Compile Include="Implementation\Regression\ConstantRegressionModel.cs" />
    125132    <Compile Include="Implementation\Regression\ConstantRegressionSolution.cs" />
     
    180187    <Compile Include="OnlineCalculators\OnlinePearsonsRSquaredCalculator.cs" />
    181188    <Compile Include="Implementation\Regression\RegressionSolution.cs" />
     189    <Compile Include="OnlineCalculators\SpearmansRankCorrelationCoefficientCalculator.cs" />
    182190    <Compile Include="Plugin.cs" />
    183191    <Compile Include="Implementation\Classification\ThresholdCalculators\AccuracyMaximizationThresholdCalculator.cs" />
     
    209217  </ItemGroup>
    210218  <ItemGroup>
     219    <ProjectReference Include="..\..\HeuristicLab.Analysis\3.3\HeuristicLab.Analysis-3.3.csproj">
     220      <Project>{887425B4-4348-49ED-A457-B7D2C26DDBF9}</Project>
     221      <Name>HeuristicLab.Analysis-3.3</Name>
     222      <Private>False</Private>
     223    </ProjectReference>
    211224    <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj">
    212225      <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project>
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblemData.cs

    r8139 r8542  
    3737    protected const string TrainingPartitionParameterName = "TrainingPartition";
    3838    protected const string TestPartitionParameterName = "TestPartition";
     39    protected const string DatasetCorrelationParameterName = "Dataset Correlation";
    3940
    4041    #region parameter properites
     
    5051    public IFixedValueParameter<IntRange> TestPartitionParameter {
    5152      get { return (IFixedValueParameter<IntRange>)Parameters[TestPartitionParameterName]; }
     53    }
     54    public IFixedValueParameter<FeatureCorrelation> DatasetCorrelationParameter {
     55      get { return (IFixedValueParameter<FeatureCorrelation>)Parameters[DatasetCorrelationParameterName]; }
    5256    }
    5357    #endregion
     
    7377    public IntRange TestPartition {
    7478      get { return TestPartitionParameter.Value; }
     79    }
     80    public FeatureCorrelation DatasetCorrelation {
     81      get { return DatasetCorrelationParameter.Value; }
    7582    }
    7683
     
    107114    [StorableConstructor]
    108115    protected DataAnalysisProblemData(bool deserializing) : base(deserializing) { }
     116
    109117    [StorableHook(HookType.AfterDeserialization)]
    110118    private void AfterDeserialization() {
    111119      RegisterEventHandlers();
     120      #region Backwards compatible code, remove with 3.4
     121      if (!Parameters.ContainsKey(DatasetCorrelationParameterName)) {
     122        Parameters.Add(new FixedValueParameter<FeatureCorrelation>(DatasetCorrelationParameterName, "", new FeatureCorrelation(this)));
     123      }
     124      #endregion
    112125    }
    113126
     
    132145      Parameters.Add(new FixedValueParameter<IntRange>(TrainingPartitionParameterName, "", new IntRange(trainingPartitionStart, trainingPartitionEnd)));
    133146      Parameters.Add(new FixedValueParameter<IntRange>(TestPartitionParameterName, "", new IntRange(testPartitionStart, testPartitionEnd)));
     147      Parameters.Add(new FixedValueParameter<FeatureCorrelation>(DatasetCorrelationParameterName, "", new FeatureCorrelation(this)));
    134148
    135149      ((ValueParameter<Dataset>)DatasetParameter).ReactOnValueToStringChangedAndValueItemImageChanged = false;
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/FeatureCorrelation.cs

    r8538 r8542  
    3535  [Item("FeatureCorrelation", "Represents the correlation of features in a data set.")]
    3636  public class FeatureCorrelation : HeatMap {
    37 
    3837    private const string PearsonsR = "Pearsons R";
    3938    private const string PearsonsRSquared = "Pearsons R Squared";
     
    5251
    5352    private IDataAnalysisProblemData problemData;
     53    [Storable]
    5454    public IDataAnalysisProblemData ProblemData {
    5555      get { return problemData; }
     
    6767    private BackgroundWorkerInfo bwInfo;
    6868
    69     public FeatureCorrelation()
     69    public FeatureCorrelation() {
     70      this.Title = "Feature Correlation";
     71      this.columnNames = problemData.Dataset.DoubleVariables.ToList();
     72      this.rowNames = problemData.Dataset.DoubleVariables.ToList();
     73      sortableView = true;
     74    }
     75    public FeatureCorrelation(IDataAnalysisProblemData problemData)
    7076      : base() {
    71       this.Title = "Feature Correlation";
    72       this.columnNames = Enumerable.Range(1, 2).Select(x => x.ToString()).ToList();
    73       this.rowNames = Enumerable.Range(1, 2).Select(x => x.ToString()).ToList();
    74       sortableView = true;
    75     }
    76 
    77     public FeatureCorrelation(IDataAnalysisProblemData problemData) {
    7877      this.problemData = problemData;
    7978      this.Title = "Feature Correlation";
     
    8483    protected FeatureCorrelation(FeatureCorrelation original, Cloner cloner)
    8584      : base(original, cloner) {
    86       this.Title = "Feature Correlation";
    87       this.problemData = original.problemData;
    88       this.columnNames = original.problemData.Dataset.DoubleVariables.ToList();
    89       this.rowNames = original.problemData.Dataset.DoubleVariables.ToList();
     85      this.problemData = cloner.Clone(original.problemData);
    9086    }
    9187    public override IDeepCloneable Clone(Cloner cloner) {
    9288      return new FeatureCorrelation(this, cloner);
    9389    }
     90
     91    [StorableConstructor]
     92    protected FeatureCorrelation(bool deserializing) : base(deserializing) { }
    9493
    9594    public void Recalculate(string calc, string partition) {
     
    244243        return OnlinePearsonsRSquaredCalculator.Calculate(var1, var2, out error);
    245244      } else {
    246         return OnlinePearsonsRSquaredCalculator.CalculateR(var1, var2, out error);
     245        return Math.Sqrt(OnlinePearsonsRSquaredCalculator.Calculate(var1, var2, out error));
    247246      }
    248247    }
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/HoeffdingsDependenceCalculator.cs

    r8355 r8542  
    2323using System.Collections.Generic;
    2424using System.Linq;
    25 using HeuristicLab.Common;
    2625
    2726namespace HeuristicLab.Problems.DataAnalysis {
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Plugin.cs.frame

    r8246 r8542  
    2828  [Plugin("HeuristicLab.Problems.DataAnalysis","Provides base classes for data analysis tasks.", "3.4.3.$WCREV$")]
    2929  [PluginFile("HeuristicLab.Problems.DataAnalysis-3.4.dll", PluginFileType.Assembly)]
     30  [PluginDependency("HeuristicLab.ALGLIB","3.6")]
     31  [PluginDependency("HeuristicLab.Analysis", "3.3")]
    3032  [PluginDependency("HeuristicLab.Collections", "3.3")]
    3133  [PluginDependency("HeuristicLab.Common", "3.3")]
Note: See TracChangeset for help on using the changeset viewer.