Changeset 5736 for branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ThresholdCalculators/NormalDistributionCutPointsThresholdCalculator.cs
- Timestamp:
- 03/17/11 15:14:45 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ThresholdCalculators/NormalDistributionCutPointsThresholdCalculator.cs
r5730 r5736 88 88 thresholdList.Sort(); 89 89 thresholdList.Insert(0, double.NegativeInfinity); 90 thresholdList.Add(double.PositiveInfinity);91 90 92 91 // determine class values for each partition separated by a threshold by calculating the density of all class distributions 93 92 // all points in the partition are classified as the class with the maximal density in the parition 94 93 List<double> classValuesList = new List<double>(); 95 for (int i = 0; i < thresholdList.Count - 1; i++) {94 for (int i = 0; i < thresholdList.Count; i++) { 96 95 double m; 97 96 if (double.IsNegativeInfinity(thresholdList[i])) { 98 97 m = thresholdList[i + 1] - 1.0; // smaller than the smalles non-infinity threshold 99 } else if (double.IsPositiveInfinity(thresholdList[i + 1])) { 100 m = thresholdList[i] + 1.0; // larger than the largest non-infinity threshold 98 } else if (i == thresholdList.Count - 1) { 99 // last threshold 100 m = thresholdList[i] + 1.0; // larger than the last threshold 101 101 } else { 102 102 m = thresholdList[i] + (thresholdList[i + 1] - thresholdList[i]) / 2.0; // middle of partition … … 135 135 } 136 136 } 137 filteredThresholds.Add(double.PositiveInfinity);138 137 thresholds = filteredThresholds.ToArray(); 139 138 classValues = filteredClassValues.ToArray();
Note: See TracChangeset
for help on using the changeset viewer.