- Timestamp:
- 08/06/15 11:06:56 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreePhenotypicSimilarityCalculator.cs
r12641 r12839 67 67 var r = OnlinePearsonsRCalculator.Calculate(v1, v2, out error); 68 68 69 if (r > 1.0) 70 r = 1.0; 69 var r2 = error == OnlineCalculatorError.None ? r * r : 0; 71 70 72 return error == OnlineCalculatorError.None ? r*r : 0; 71 if (r2 > 1.0) 72 r2 = 1.0; 73 74 return r2; 73 75 } 74 76 … … 89 91 var r = OnlinePearsonsRCalculator.Calculate(leftValues, rightValues, out error); 90 92 91 if (r > 1.0) 92 r = 1.0; // sometimes due to fp errors it can happen that the correlation is over 1 (like 1.0000000009) 93 var r2 = error == OnlineCalculatorError.None ? r * r : 0; 93 94 94 return error == OnlineCalculatorError.None ? r*r : 0; 95 if (r2 > 1.0) 96 r2 = 1.0; 97 98 return r2; 95 99 } 96 100 }
Note: See TracChangeset
for help on using the changeset viewer.