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.

File:
1 copied

Legend:

Unmodified
Added
Removed
  • 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    }
Note: See TracChangeset for help on using the changeset viewer.