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/MajorityVoteWeightCalculator.cs

    r7866 r8297  
    6161      return ((double)correctEstimated / (double)solutions.Count() - 0.5) * 2;
    6262    }
     63
     64    public override IEnumerable<double> GetConfidence(IEnumerable<IClassificationSolution> solutions, IEnumerable<int> indices, IEnumerable<double> estimatedClassValue) {
     65      if (solutions.Count() < 1)
     66        return Enumerable.Repeat(double.NaN, indices.Count());
     67      Dataset dataset = solutions.First().ProblemData.Dataset;
     68      var estimationsPerSolution = solutions.Select(s => s.Model.GetEstimatedClassValues(dataset, indices).ToArray()).ToArray();
     69      double[] estimatedClassValueArr = estimatedClassValue.ToArray();
     70      double correctEstimated;
     71      double[] confidences = new double[indices.Count()];
     72
     73      for (int i = 0; i < indices.Count(); i++) {
     74        correctEstimated = estimationsPerSolution.Where(x => DoubleExtensions.IsAlmost(x[i], estimatedClassValueArr[i])).Count();
     75        confidences[i] = (correctEstimated / (double)solutions.Count() - 0.5) * 2;
     76      }
     77
     78      return confidences;
     79    }
    6380  }
    6481}
Note: See TracChangeset for help on using the changeset viewer.