Changeset 12137 for trunk/sources
- Timestamp:
- 03/05/15 11:25:59 (10 years ago)
- Location:
- trunk/sources
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Analysis.Statistics.Views/3.3/CorrelationView.cs
r12116 r12137 214 214 .Where(x => !double.IsNaN(x) && !double.IsNegativeInfinity(x) && !double.IsPositiveInfinity(x)); 215 215 216 if (!rowValues.Any() || !columnValues.Any() || i == j ||rowValues.Count() != columnValues.Count()) {216 if (!rowValues.Any() || !columnValues.Any() || rowValues.Count() != columnValues.Count()) { 217 217 dt[i, j] = double.NaN; 218 } else if (i == j) { 219 dt[i, j] = 1.0; 218 220 } else { 219 221 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 221 223 } 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 223 225 } 224 226 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/FeatureCorrelationCalculator.cs
r12012 r12137 139 139 IEnumerable<double> var2 = problemData.Dataset.GetDoubleValues(doubleVariableNames[j], indices); 140 140 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 142 142 143 143 if (!error.Equals(OnlineCalculatorError.None)) {
Note: See TracChangeset
for help on using the changeset viewer.