Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/05/15 11:25:59 (9 years ago)
Author:
gkronber
Message:

#2352: only show correlations to 3 digits accuracy.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Analysis.Statistics.Views/3.3/CorrelationView.cs

    r12116 r12137  
    214214                .Where(x => !double.IsNaN(x) && !double.IsNegativeInfinity(x) && !double.IsPositiveInfinity(x));
    215215
    216           if (!rowValues.Any() || !columnValues.Any() || i == j || rowValues.Count() != columnValues.Count()) {
     216          if (!rowValues.Any() || !columnValues.Any() || rowValues.Count() != columnValues.Count()) {
    217217            dt[i, j] = double.NaN;
     218          } else if (i == j) {
     219            dt[i, j] = 1.0;
    218220          } else {
    219221            if (methodName == PearsonName) {
    220               dt[i, j] = alglib.pearsoncorr2(rowValues.ToArray(), columnValues.ToArray());
     222              dt[i, j] = Math.Round(alglib.pearsoncorr2(rowValues.ToArray(), columnValues.ToArray()), 3); // for correlations it is usually sufficient to show only 3 digits
    221223            } else {
    222               dt[i, j] = alglib.spearmancorr2(rowValues.ToArray(), columnValues.ToArray());
     224              dt[i, j] = Math.Round(alglib.spearmancorr2(rowValues.ToArray(), columnValues.ToArray()), 3); // for correlations it is usually sufficient to show only 3 digits
    223225            }
    224226          }
Note: See TracChangeset for help on using the changeset viewer.