Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/17/11 15:14:45 (13 years ago)
Author:
gkronber
Message:

#1418 implemented linear scaling for classification solutions, fixed bugs interactive simplifier view for classification solutions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ThresholdCalculators/NormalDistributionCutPointsThresholdCalculator.cs

    r5730 r5736  
    8888      thresholdList.Sort();
    8989      thresholdList.Insert(0, double.NegativeInfinity);
    90       thresholdList.Add(double.PositiveInfinity);
    9190
    9291      // determine class values for each partition separated by a threshold by calculating the density of all class distributions
    9392      // all points in the partition are classified as the class with the maximal density in the parition
    9493      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++) {
    9695        double m;
    9796        if (double.IsNegativeInfinity(thresholdList[i])) {
    9897          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
    101101        } else {
    102102          m = thresholdList[i] + (thresholdList[i + 1] - thresholdList[i]) / 2.0; // middle of partition
     
    135135        }
    136136      }
    137       filteredThresholds.Add(double.PositiveInfinity);
    138137      thresholds = filteredThresholds.ToArray();
    139138      classValues = filteredClassValues.ToArray();
Note: See TracChangeset for help on using the changeset viewer.