Changeset 8297 for branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification
- Timestamp:
- 07/17/12 15:30:04 (12 years ago)
- Location:
- branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationEnsembleSolutionEstimatedClassValuesView.cs
r8101 r8297 28 28 using HeuristicLab.MainForm; 29 29 using HeuristicLab.MainForm.WindowsForms; 30 using HeuristicLab.Problems.DataAnalysis.Interfaces .Classification;30 using HeuristicLab.Problems.DataAnalysis.Interfaces; 31 31 32 32 namespace HeuristicLab.Problems.DataAnalysis.Views { … … 111 111 double curConfidence; 112 112 113 double[] confidences = null; 114 if (SamplesComboBox.SelectedItem.ToString() == SamplesComboBoxAllSamples) { 115 confidences = weightCalc.GetConfidence(solutions, indizes, estimatedClassValues).ToArray(); 116 } 117 113 118 for (int i = 0; i < indizes.Length; i++) { 114 119 int row = indizes[i]; … … 120 125 correctClassified = target[i].IsAlmost(estimatedClassValues[i]); 121 126 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 } 123 133 if (correctClassified) { 124 134 confidence[0] += curConfidence; … … 156 166 matrix.SortableView = true; 157 167 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>(); 158 179 } 159 180
Note: See TracChangeset
for help on using the changeset viewer.