- Timestamp:
- 05/30/11 17:31:53 (14 years ago)
- Location:
- branches/histogram
- Files:
-
- 8 edited
- 9 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/histogram
- Property svn:mergeinfo changed
/trunk/sources merged: 6201,6205,6207-6209,6223,6233-6241,6250,6252,6254-6256,6259,6262,6265,6291,6298,6302
- Property svn:mergeinfo changed
-
branches/histogram/HeuristicLab.Algorithms.DataAnalysis/3.4/CrossValidation.cs
r6195 r6340 376 376 results.Add(result.Name, result.Value); 377 377 } 378 foreach (IResult result in ExtractAndAggregateClassificationSolutions(resultCollections)) { 379 results.Add(result.Name, result.Value); 380 } 378 381 results.Add("Execution Time", new TimeSpanValue(this.ExecutionTime)); 379 382 results.Add("CrossValidation Folds", new RunCollection(runs)); … … 401 404 solutions.Value.Select(x => x.ProblemData.TestPartition)); 402 405 403 aggregatedResults.Add(new Result(solutions.Key, ensembleSolution)); 404 } 405 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; 411 } 412 413 private IEnumerable<IResult> ExtractAndAggregateClassificationSolutions(IEnumerable<KeyValuePair<string, IItem>> resultCollections) { 414 Dictionary<string, List<IClassificationSolution>> resultSolutions = new Dictionary<string, List<IClassificationSolution>>(); 415 foreach (var result in resultCollections) { 416 var classificationSolution = result.Value as IClassificationSolution; 417 if (classificationSolution != null) { 418 if (resultSolutions.ContainsKey(result.Key)) { 419 resultSolutions[result.Key].Add(classificationSolution); 420 } else { 421 resultSolutions.Add(result.Key, new List<IClassificationSolution>() { classificationSolution }); 422 } 423 } 424 } 425 var aggregatedResults = new List<IResult>(); 426 foreach (KeyValuePair<string, List<IClassificationSolution>> solutions in resultSolutions) { 427 var problemDataClone = (IClassificationProblemData)Problem.ProblemData.Clone(); 428 problemDataClone.TrainingPartition.Start = SamplesStart.Value; problemDataClone.TrainingPartition.End = SamplesEnd.Value; 429 problemDataClone.TestPartition.Start = SamplesStart.Value; problemDataClone.TestPartition.End = SamplesEnd.Value; 430 var ensembleSolution = new ClassificationEnsembleSolution(solutions.Value.Select(x => x.Model), problemDataClone, 431 solutions.Value.Select(x => x.ProblemData.TrainingPartition), 432 solutions.Value.Select(x => x.ProblemData.TestPartition)); 433 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 } 406 449 } 407 450 … … 428 471 foreach (KeyValuePair<string, List<double>> resultValue in resultValues) { 429 472 doubleValue.Value = resultValue.Value.Average(); 430 aggregatedResults.Add(new Result(resultValue.Key , (IItem)doubleValue.Clone()));473 aggregatedResults.Add(new Result(resultValue.Key + " (average)", (IItem)doubleValue.Clone())); 431 474 doubleValue.Value = resultValue.Value.StandardDeviation(); 432 aggregatedResults.Add(new Result(resultValue.Key + " StdDev", (IItem)doubleValue.Clone()));475 aggregatedResults.Add(new Result(resultValue.Key + " (std.dev.)", (IItem)doubleValue.Clone())); 433 476 } 434 477 return aggregatedResults; -
branches/histogram/HeuristicLab.Algorithms.DataAnalysis/3.4/HeuristicLab.Algorithms.DataAnalysis-3.4.csproj
r5809 r6340 112 112 <Compile Include="HeuristicLabAlgorithmsDataAnalysisPlugin.cs" /> 113 113 <Compile Include="FixedDataAnalysisAlgorithm.cs" /> 114 <Compile Include="Interfaces\IRandomForestClassificationSolution.cs" /> 115 <Compile Include="Interfaces\IRandomForestModel.cs" /> 116 <Compile Include="Interfaces\IRandomForestRegressionSolution.cs" /> 114 117 <Compile Include="Interfaces\ISupportVectorMachineModel.cs" /> 115 118 <Compile Include="Interfaces\ISupportVectorMachineSolution.cs" /> … … 127 130 </Compile> 128 131 <Compile Include="Properties\AssemblyInfo.cs" /> 132 <Compile Include="RandomForest\RandomForestClassificationSolution.cs" /> 133 <Compile Include="RandomForest\RandomForestClassification.cs" /> 134 <Compile Include="RandomForest\RandomForestModel.cs" /> 135 <Compile Include="RandomForest\RandomForestRegression.cs" /> 136 <Compile Include="RandomForest\RandomForestRegressionSolution.cs" /> 129 137 <Compile Include="SupportVectorMachine\SupportVectorClassification.cs" /> 130 138 <Compile Include="SupportVectorMachine\SupportVectorClassificationSolution.cs" /> -
branches/histogram/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/LinearDiscriminantAnalysis.cs
r6195 r6340 36 36 /// Linear discriminant analysis classification algorithm. 37 37 /// </summary> 38 [Item("Linear Discriminant Analysis", "Linear discriminant analysis classification algorithm .")]38 [Item("Linear Discriminant Analysis", "Linear discriminant analysis classification algorithm (wrapper for ALGLIB).")] 39 39 [Creatable("Data Analysis")] 40 40 [StorableClass] -
branches/histogram/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/LinearRegression.cs
r6195 r6340 37 37 /// Linear regression data analysis algorithm. 38 38 /// </summary> 39 [Item("Linear Regression", "Linear regression data analysis algorithm .")]39 [Item("Linear Regression", "Linear regression data analysis algorithm (wrapper for ALGLIB).")] 40 40 [Creatable("Data Analysis")] 41 41 [StorableClass] -
branches/histogram/HeuristicLab.Algorithms.DataAnalysis/3.4/SupportVectorMachine/SupportVectorClassification.cs
r6195 r6340 35 35 /// Support vector machine classification data analysis algorithm. 36 36 /// </summary> 37 [Item("Support Vector Classification", "Support vector machine classification data analysis algorithm .")]37 [Item("Support Vector Classification", "Support vector machine classification data analysis algorithm (wrapper for libSVM).")] 38 38 [Creatable("Data Analysis")] 39 39 [StorableClass] -
branches/histogram/HeuristicLab.Algorithms.DataAnalysis/3.4/SupportVectorMachine/SupportVectorRegression.cs
r6195 r6340 35 35 /// Support vector machine regression data analysis algorithm. 36 36 /// </summary> 37 [Item("Support Vector Regression", "Support vector machine regression data analysis algorithm .")]37 [Item("Support Vector Regression", "Support vector machine regression data analysis algorithm (wrapper for libSVM).")] 38 38 [Creatable("Data Analysis")] 39 39 [StorableClass] -
branches/histogram/HeuristicLab.Algorithms.DataAnalysis/3.4/kMeans/KMeansClustering.cs
r6195 r6340 35 35 /// k-Means clustering algorithm data analysis algorithm. 36 36 /// </summary> 37 [Item("k-Means", "The k-Means clustering algorithm .")]37 [Item("k-Means", "The k-Means clustering algorithm (wrapper for ALGLIB).")] 38 38 [Creatable("Data Analysis")] 39 39 [StorableClass]
Note: See TracChangeset
for help on using the changeset viewer.