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

#2619:

  • Refactored and separated the different feature correlation calculations.
  • Added a checkbox to ignore missing values in the calculation.
File:
1 edited

Legend:

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