Changeset 6250 for trunk/sources/HeuristicLab.Algorithms.DataAnalysis
- Timestamp:
- 05/23/11 14:47:27 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/CrossValidation.cs
r6239 r6250 404 404 solutions.Value.Select(x => x.ProblemData.TestPartition)); 405 405 406 aggregatedResults.Add(new Result(solutions.Key, ensembleSolution)); 407 } 408 return aggregatedResults; 406 aggregatedResults.Add(new Result(solutions.Key + " (ensemble)", ensembleSolution)); 407 } 408 List<IResult> flattenedResults = new List<IResult>(); 409 CollectResultsRecursively("", aggregatedResults, flattenedResults); 410 return flattenedResults; 409 411 } 410 412 … … 421 423 } 422 424 } 423 List<IResult>aggregatedResults = new List<IResult>();425 var aggregatedResults = new List<IResult>(); 424 426 foreach (KeyValuePair<string, List<IClassificationSolution>> solutions in resultSolutions) { 425 427 var problemDataClone = (IClassificationProblemData)Problem.ProblemData.Clone(); … … 430 432 solutions.Value.Select(x => x.ProblemData.TestPartition)); 431 433 432 aggregatedResults.Add(new Result(solutions.Key, ensembleSolution)); 433 } 434 return aggregatedResults; 434 aggregatedResults.Add(new Result(solutions.Key + " (ensemble)", ensembleSolution)); 435 } 436 List<IResult> flattenedResults = new List<IResult>(); 437 CollectResultsRecursively("", aggregatedResults, flattenedResults); 438 return flattenedResults; 439 } 440 441 private void CollectResultsRecursively(string path, IEnumerable<IResult> results, IList<IResult> flattenedResults) { 442 foreach (IResult result in results) { 443 flattenedResults.Add(new Result(path + result.Name, result.Value)); 444 ResultCollection childCollection = result.Value as ResultCollection; 445 if (childCollection != null) { 446 CollectResultsRecursively(path + result.Name + ".", childCollection, flattenedResults); 447 } 448 } 435 449 } 436 450 … … 457 471 foreach (KeyValuePair<string, List<double>> resultValue in resultValues) { 458 472 doubleValue.Value = resultValue.Value.Average(); 459 aggregatedResults.Add(new Result(resultValue.Key , (IItem)doubleValue.Clone()));473 aggregatedResults.Add(new Result(resultValue.Key + " (average)", (IItem)doubleValue.Clone())); 460 474 doubleValue.Value = resultValue.Value.StandardDeviation(); 461 aggregatedResults.Add(new Result(resultValue.Key + " StdDev", (IItem)doubleValue.Clone()));475 aggregatedResults.Add(new Result(resultValue.Key + " (std.dev.)", (IItem)doubleValue.Clone())); 462 476 } 463 477 return aggregatedResults;
Note: See TracChangeset
for help on using the changeset viewer.