Free cookie consent management tool by TermsFeed Policy Generator

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

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

Location:
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ThresholdCalculators
Files:
2 edited

Legend:

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

    r5730 r5736  
    6969      classValues = problemData.ClassValues.OrderBy(x => x).ToArray();
    7070      int nClasses = classValues.Length;
    71       thresholds = new double[nClasses + 1];
     71      thresholds = new double[nClasses];
    7272      thresholds[0] = double.NegativeInfinity;
    73       thresholds[thresholds.Length - 1] = double.PositiveInfinity;
     73      // thresholds[thresholds.Length - 1] = double.PositiveInfinity;
    7474
    7575      // incrementally calculate accuracy of all possible thresholds
    7676      int[,] confusionMatrix = new int[nClasses, nClasses];
    7777
    78       for (int i = 1; i < thresholds.Length - 1; i++) {
     78      for (int i = 1; i < thresholds.Length; i++) {
    7979        double lowerThreshold = thresholds[i - 1];
    8080        double actualThreshold = Math.Max(lowerThreshold, minEstimatedValue);
  • 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.