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.Views/3.4/Classification/ClassificationEnsembleSolutionEstimatedClassValuesView.cs

    r8101 r8297  
    2828using HeuristicLab.MainForm;
    2929using HeuristicLab.MainForm.WindowsForms;
    30 using HeuristicLab.Problems.DataAnalysis.Interfaces.Classification;
     30using HeuristicLab.Problems.DataAnalysis.Interfaces;
    3131
    3232namespace HeuristicLab.Problems.DataAnalysis.Views {
     
    111111      double curConfidence;
    112112
     113      double[] confidences = null;
     114      if (SamplesComboBox.SelectedItem.ToString() == SamplesComboBoxAllSamples) {
     115        confidences = weightCalc.GetConfidence(solutions, indizes, estimatedClassValues).ToArray();
     116      }
     117
    113118      for (int i = 0; i < indizes.Length; i++) {
    114119        int row = indizes[i];
     
    120125          correctClassified = target[i].IsAlmost(estimatedClassValues[i]);
    121126          values[i, 3] = correctClassified.ToString();
    122           curConfidence = weightCalc.GetConfidence(solutions, indizes[i], estimatedClassValues[i]);
     127          if (SamplesComboBox.SelectedItem.ToString() == SamplesComboBoxAllSamples) {
     128            curConfidence = confidences[i];
     129          } else {
     130            curConfidence = weightCalc.GetConfidence(GetRelevantSolutions(SamplesComboBox.SelectedItem.ToString(), solutions, row),
     131                                                     indizes[i], estimatedClassValues[i]);
     132          }
    123133          if (correctClassified) {
    124134            confidence[0] += curConfidence;
     
    156166      matrix.SortableView = true;
    157167      matrixView.Content = matrix;
     168    }
     169
     170    protected IEnumerable<IClassificationSolution> GetRelevantSolutions(string samplesSelection, IEnumerable<IClassificationSolution> solutions, int curRow) {
     171      if (samplesSelection == SamplesComboBoxAllSamples)
     172        return solutions;
     173      else if (samplesSelection == SamplesComboBoxTrainingSamples)
     174        return solutions.Where(s => s.ProblemData.IsTrainingSample(curRow));
     175      else if (samplesSelection == SamplesComboBoxTestSamples)
     176        return solutions.Where(s => s.ProblemData.IsTestSample(curRow));
     177      else
     178        return new List<IClassificationSolution>();
    158179    }
    159180
Note: See TracChangeset for help on using the changeset viewer.