Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/17/12 15:30:04 (12 years ago)
Author:
sforsten
Message:

#1776:

  • Corrected namespace of IClassificationEnsembleSolutionWeightCalculator interface
  • Corrected calculation of confidence for test and training samples in ClassificationEnsembleSolutionEstimatedClassValuesView
  • Added overload method GetConfidence to IClassificationEnsembleSolutionWeightCalculator to calculate more than one point at a time (maybe additional methods for training and test confidence could improve the performance remarkably)
  • Added ClassificationEnsembleSolutionConfidenceAccuracyDependence to see how accuracy would behave, if only samples with high confidence would be classified
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/MedianThresholdCalculator.cs

    r8101 r8297  
    6666        return double.NaN;
    6767      double median = GetMedian(values);
     68      return GetMedianConfidence(median, estimatedClassValue);
     69    }
     70
     71    public override IEnumerable<double> GetDiscriminantConfidence(IEnumerable<IDiscriminantFunctionClassificationSolution> solutions, IEnumerable<int> indices, IEnumerable<double> estimatedClassValue) {
     72      if (!classValues.Count().Equals(2))
     73        return Enumerable.Repeat(double.NaN, indices.Count());
     74
     75      Dataset dataset = solutions.First().ProblemData.Dataset;
     76      double[][] values = solutions.Select(s => s.Model.GetEstimatedValues(dataset, indices).ToArray()).ToArray();
     77      double[] confidences = new double[indices.Count()];
     78      double[] estimatedClassValueArr = estimatedClassValue.ToArray();
     79
     80      for (int i = 0; i < indices.Count(); i++) {
     81        double avg = values.Select(x => x[i]).Average();
     82        confidences[i] = GetMedianConfidence(avg, estimatedClassValueArr[i]);
     83      }
     84
     85      return confidences;
     86    }
     87
     88    protected double GetMedianConfidence(double median, double estimatedClassValue) {
    6889      if (estimatedClassValue.Equals(classValues[0])) {
    6990        if (median < estimatedClassValue)
Note: See TracChangeset for help on using the changeset viewer.