Changeset 7562 for branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4
- Timestamp:
- 03/06/12 15:08:13 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationEnsembleSolutionEstimatedClassValuesView.cs
r7531 r7562 28 28 using HeuristicLab.MainForm; 29 29 using HeuristicLab.MainForm.WindowsForms; 30 using HeuristicLab.Problems.DataAnalysis.Interfaces.Classification; 30 31 31 32 namespace HeuristicLab.Problems.DataAnalysis.Views { … … 96 97 } 97 98 99 IEnumerable<IClassificationSolution> solutions = Content.ClassificationSolutions.CheckedItems; 98 100 int classValuesCount = Content.ProblemData.ClassValues.Count; 99 int solutionsCount = Content.ClassificationSolutions.Count();101 int solutionsCount = solutions.Count(); 100 102 string[,] values = new string[indizes.Length, 5 + classValuesCount + solutionsCount]; 101 103 double[] target = Content.ProblemData.Dataset.GetDoubleValues(Content.ProblemData.TargetVariable).ToArray(); 102 104 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; 106 108 107 109 for (int i = 0; i < indizes.Length; i++) { … … 113 115 values[i, 2] = estimatedClassValues[i].ToString(); 114 116 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(); 128 118 129 119 var groups = … … 145 135 List<string> columnNames = new List<string>() { "Id", TargetClassValuesColumnName, EstimatedClassValuesColumnName, CorrectClassificationColumnName, ConfidenceColumnName }; 146 136 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)); 148 138 matrix.ColumnNames = columnNames; 149 139 matrix.SortableView = true;
Note: See TracChangeset
for help on using the changeset viewer.