Changeset 8859
- Timestamp:
- 10/30/12 12:41:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationEnsembleSolutionEstimatedClassValuesView.cs
r8554 r8859 106 106 int row = indices[i]; 107 107 values[i, 0] = row.ToString(); 108 values[i, 1] = target[ i].ToString();108 values[i, 1] = target[row].ToString(); 109 109 //display only indices and target values if no models are present 110 110 if (solutionsCount > 0) { 111 111 values[i, 2] = estimatedClassValues[i].ToString(); 112 values[i, 3] = (target[ i].IsAlmost(estimatedClassValues[i])).ToString();112 values[i, 3] = (target[row].IsAlmost(estimatedClassValues[i])).ToString(); 113 113 var groups = 114 114 estimatedValuesVector[i].GroupBy(x => x).Select(g => new { Key = g.Key, Count = g.Count() }).ToList(); 115 115 var estimationCount = groups.Where(g => g.Key != null).Select(g => g.Count).Sum(); 116 values[i, 4] = (((double)groups.Where(g => g.Key == estimatedClassValues[i]).Single().Count) / estimationCount).ToString(); 116 // take care of divide by zero 117 if (estimationCount != 0) { 118 values[i, 4] = (((double)groups.Where(g => g.Key == estimatedClassValues[i]).Single().Count) / estimationCount).ToString(); 119 } else { 120 values[i, 4] = double.NaN.ToString(); 121 } 117 122 for (int classIndex = 0; classIndex < Content.ProblemData.Classes; classIndex++) { 118 123 var group = groups.Where(g => g.Key == Content.ProblemData.ClassValues.ElementAt(classIndex)).SingleOrDefault();
Note: See TracChangeset
for help on using the changeset viewer.