Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/06/12 15:08:13 (13 years ago)
Author:
sforsten
Message:

#1776:

  • bug fix in NeighbourhoodWeightCalculator
  • added GetConfidence method to IClassificationEnsembleSolutionWeightCalculator
  • adjusted the confidence column in ClassificationEnsembleSolutionEstimatedClassValuesView
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationEnsembleSolutionEstimatedClassValuesView.cs

    r7531 r7562  
    2828using HeuristicLab.MainForm;
    2929using HeuristicLab.MainForm.WindowsForms;
     30using HeuristicLab.Problems.DataAnalysis.Interfaces.Classification;
    3031
    3132namespace HeuristicLab.Problems.DataAnalysis.Views {
     
    9697      }
    9798
     99      IEnumerable<IClassificationSolution> solutions = Content.ClassificationSolutions.CheckedItems;
    98100      int classValuesCount = Content.ProblemData.ClassValues.Count;
    99       int solutionsCount = Content.ClassificationSolutions.Count();
     101      int solutionsCount = solutions.Count();
    100102      string[,] values = new string[indizes.Length, 5 + classValuesCount + solutionsCount];
    101103      double[] target = Content.ProblemData.Dataset.GetDoubleValues(Content.ProblemData.TargetVariable).ToArray();
    102104      List<List<double?>> estimatedValuesVector = GetEstimatedValues(SamplesComboBox.SelectedItem.ToString(), indizes,
    103                                                             Content.ClassificationSolutions);
    104       //List<double> weights = Content.Weights.ToList();
    105       //double weightSum = weights.Sum();
     105                                                            solutions);
     106
     107      IClassificationEnsembleSolutionWeightCalculator weightCalc = Content.WeightCalculator;
    106108
    107109      for (int i = 0; i < indizes.Length; i++) {
     
    113115          values[i, 2] = estimatedClassValues[i].ToString();
    114116          values[i, 3] = (target[i].IsAlmost(estimatedClassValues[i])).ToString();
    115 
    116           //currently disabled for test purpose
    117 
    118           //IEnumerable<int> indices = FindAllIndices(estimatedValuesVector[i], estimatedClassValues[i]);
    119           //double confidence = 0.0;
    120           //foreach (var index in indices) {
    121           //  confidence += weights[index];
    122           //}
    123           //values[i, 4] = (confidence / weightSum).ToString();
    124           //var estimationCount = groups.Where(g => g.Key != null).Select(g => g.Count).Sum();
    125           //values[i, 4] =
    126           //  (((double)groups.Where(g => g.Key == estimatedClassValues[i]).Single().Count) / estimationCount).ToString();
    127           values[i, 4] = "1.0";
     117          values[i, 4] = weightCalc.GetConfidence(solutions, indizes[i], estimatedClassValues[i]).ToString();
    128118
    129119          var groups =
     
    145135      List<string> columnNames = new List<string>() { "Id", TargetClassValuesColumnName, EstimatedClassValuesColumnName, CorrectClassificationColumnName, ConfidenceColumnName };
    146136      columnNames.AddRange(Content.ProblemData.ClassNames);
    147       columnNames.AddRange(Content.Model.Models.Select(m => m.Name));
     137      columnNames.AddRange(Content.ClassificationSolutions.CheckedItems.Select(s => s.Model.Name));//.Model.Models.Select(m => m.Name));
    148138      matrix.ColumnNames = columnNames;
    149139      matrix.SortableView = true;
Note: See TracChangeset for help on using the changeset viewer.