Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/27/16 15:28:26 (9 years ago)
Author:
mkommend
Message:

#2619:

  • Refactored and separated the different feature correlation calculations.
  • Added a checkbox to ignore missing values in the calculation.
Location:
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/DependencyCalculator
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/DependencyCalculator/HoeffdingsDependenceCalculator.cs

    r12012 r13938  
    4141      if (errorState != OnlineCalculatorError.None) return double.NaN;
    4242      return d;
     43    }
     44
     45    public double Calculate(IEnumerable<Tuple<double, double>> values, out OnlineCalculatorError errorState) {
     46      return HoeffD(values.Select(v => v.Item1), values.Select(v => v.Item2), out errorState);
    4347    }
    4448
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/DependencyCalculator/PearsonsRDependenceCalculator.cs

    r12492 r13938  
    3535      return OnlinePearsonsRCalculator.Calculate(originalValues, estimatedValues, out errorState);
    3636    }
     37
     38    public double Calculate(IEnumerable<Tuple<double, double>> values, out OnlineCalculatorError errorState) {
     39      var calculator = new OnlinePearsonsRCalculator();
     40      foreach (var tuple in values) {
     41        calculator.Add(tuple.Item1, tuple.Item2);
     42        if (calculator.ErrorState != OnlineCalculatorError.None) break;
     43      }
     44      errorState = calculator.ErrorState;
     45      return calculator.R;
     46    }
    3747  }
    3848}
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/DependencyCalculator/PearsonsRSquaredDependenceCalculator.cs

    r12641 r13938  
    2020#endregion
    2121
     22using System;
    2223using System.Collections.Generic;
    2324
     
    3536      return r * r;
    3637    }
     38
     39    public double Calculate(IEnumerable<Tuple<double, double>> values, out OnlineCalculatorError errorState) {
     40      var calculator = new OnlinePearsonsRCalculator();
     41      foreach (var tuple in values) {
     42        calculator.Add(tuple.Item1, tuple.Item2);
     43        if (calculator.ErrorState != OnlineCalculatorError.None) break;
     44      }
     45      errorState = calculator.ErrorState;
     46      var r = calculator.R;
     47      return r * r;
     48    }
    3749  }
    3850}
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/DependencyCalculator/SpearmansRankCorrelationCoefficientCalculator.cs

    r12817 r13938  
    2020#endregion
    2121
     22using System;
    2223using System.Collections.Generic;
    2324using System.Linq;
     
    3334
    3435    public double Calculate(IEnumerable<double> originalValues, IEnumerable<double> estimatedValues, out OnlineCalculatorError errorState) {
    35       return SpearmansRankCorrelationCoefficientCalculator.CalculateSpearmansRank(originalValues, estimatedValues, out errorState);
     36      return CalculateSpearmansRank(originalValues, estimatedValues, out errorState);
     37    }
     38    public double Calculate(IEnumerable<Tuple<double, double>> values, out OnlineCalculatorError errorState) {
     39      return CalculateSpearmansRank(values.Select(v => v.Item1), values.Select(v => v.Item2), out errorState);
    3640    }
    3741
     
    5054      return rs;
    5155    }
     56
     57
    5258  }
    5359}
Note: See TracChangeset for help on using the changeset viewer.