Free cookie consent management tool by TermsFeed Policy Generator

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

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

Location:
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4
Files:
4 edited
2 copied

Legend:

Unmodified
Added
Removed
  • 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.