Changeset 4126
 Timestamp:
 08/01/10 18:11:15 (14 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/OnlinePearsonsRSquaredEvaluator.cs
r4122 r4126 31 31 public double RSquared { 32 32 get { 33 double r = covEvaluator.Covariance / (Math.Sqrt(sxEvaluator.PopulationVariance) * Math.Sqrt(syEvaluator.PopulationVariance)); 34 return r * r; 33 double xVar = sxEvaluator.PopulationVariance; 34 double yVar = syEvaluator.PopulationVariance; 35 if (xVar.IsAlmost(0.0)  yVar.IsAlmost(0.0)) { 36 return 0.0; 37 } else { 38 double r = covEvaluator.Covariance / (Math.Sqrt(xVar) * Math.Sqrt(yVar)); 39 return r * r; 40 } 35 41 } 36 42 }
Note: See TracChangeset
for help on using the changeset viewer.