Changeset 8542 for trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/FeatureCorrelation.cs
- Timestamp:
- 08/30/12 11:47:47 (12 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/FeatureCorrelation.cs
r8538 r8542 35 35 [Item("FeatureCorrelation", "Represents the correlation of features in a data set.")] 36 36 public class FeatureCorrelation : HeatMap { 37 38 37 private const string PearsonsR = "Pearsons R"; 39 38 private const string PearsonsRSquared = "Pearsons R Squared"; … … 52 51 53 52 private IDataAnalysisProblemData problemData; 53 [Storable] 54 54 public IDataAnalysisProblemData ProblemData { 55 55 get { return problemData; } … … 67 67 private BackgroundWorkerInfo bwInfo; 68 68 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) 70 76 : 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) {78 77 this.problemData = problemData; 79 78 this.Title = "Feature Correlation"; … … 84 83 protected FeatureCorrelation(FeatureCorrelation original, Cloner cloner) 85 84 : 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); 90 86 } 91 87 public override IDeepCloneable Clone(Cloner cloner) { 92 88 return new FeatureCorrelation(this, cloner); 93 89 } 90 91 [StorableConstructor] 92 protected FeatureCorrelation(bool deserializing) : base(deserializing) { } 94 93 95 94 public void Recalculate(string calc, string partition) { … … 244 243 return OnlinePearsonsRSquaredCalculator.Calculate(var1, var2, out error); 245 244 } else { 246 return OnlinePearsonsRSquaredCalculator.CalculateR(var1, var2, out error);245 return Math.Sqrt(OnlinePearsonsRSquaredCalculator.Calculate(var1, var2, out error)); 247 246 } 248 247 }
Note: See TracChangeset
for help on using the changeset viewer.