Free cookie consent management tool by TermsFeed Policy Generator

Changeset 12137 for trunk/sources


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

#2352: only show correlations to 3 digits accuracy.

Location:
trunk/sources
Files:
2 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          }
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/FeatureCorrelationCalculator.cs

    r12012 r12137  
    139139          IEnumerable<double> var2 = problemData.Dataset.GetDoubleValues(doubleVariableNames[j], indices);
    140140
    141           elements[i, j] = calc.Calculate(var1, var2, out error);
     141          elements[i, j] = Math.Round(calc.Calculate(var1, var2, out error), 3); // only show correlations to 3 digits accuracy
    142142
    143143          if (!error.Equals(OnlineCalculatorError.None)) {
Note: See TracChangeset for help on using the changeset viewer.