Changeset 6195 for branches/histogram/HeuristicLab.Algorithms.DataAnalysis
- Timestamp:
- 05/14/11 16:45:46 (14 years ago)
- Location:
- branches/histogram
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/histogram
-
branches/histogram/HeuristicLab.Algorithms.DataAnalysis/3.3/HeuristicLabAlgorithmsDataAnalysisPlugin.cs.frame
r5446 r6195 26 26 /// Plugin class for HeuristicLab.Algorithms.DataAnalysis plugin. 27 27 /// </summary> 28 [Plugin("HeuristicLab.Algorithms.DataAnalysis", "3.3. 3.$WCREV$")]28 [Plugin("HeuristicLab.Algorithms.DataAnalysis", "3.3.4.$WCREV$")] 29 29 [PluginFile("HeuristicLab.Algorithms.DataAnalysis-3.3.dll", PluginFileType.Assembly)] 30 30 [PluginDependency("HeuristicLab.Collections", "3.3")] -
branches/histogram/HeuristicLab.Algorithms.DataAnalysis/3.3/Properties/AssemblyInfo.frame
r5446 r6195 53 53 // by using the '*' as shown below: 54 54 [assembly: AssemblyVersion("3.3.0.0")] 55 [assembly: AssemblyFileVersion("3.3. 3.$WCREV$")]55 [assembly: AssemblyFileVersion("3.3.4.$WCREV$")] -
branches/histogram/HeuristicLab.Algorithms.DataAnalysis/3.4/CrossValidation.cs
r5886 r6195 373 373 foreach (IResult result in ExtractAndAggregateResults<PercentValue>(resultCollections)) 374 374 results.Add(result.Name, result.Value); 375 375 foreach (IResult result in ExtractAndAggregateRegressionSolutions(resultCollections)) { 376 results.Add(result.Name, result.Value); 377 } 376 378 results.Add("Execution Time", new TimeSpanValue(this.ExecutionTime)); 377 379 results.Add("CrossValidation Folds", new RunCollection(runs)); 380 } 381 382 private IEnumerable<IResult> ExtractAndAggregateRegressionSolutions(IEnumerable<KeyValuePair<string, IItem>> resultCollections) { 383 Dictionary<string, List<IRegressionSolution>> resultSolutions = new Dictionary<string, List<IRegressionSolution>>(); 384 foreach (var result in resultCollections) { 385 var regressionSolution = result.Value as IRegressionSolution; 386 if (regressionSolution != null) { 387 if (resultSolutions.ContainsKey(result.Key)) { 388 resultSolutions[result.Key].Add(regressionSolution); 389 } else { 390 resultSolutions.Add(result.Key, new List<IRegressionSolution>() { regressionSolution }); 391 } 392 } 393 } 394 List<IResult> aggregatedResults = new List<IResult>(); 395 foreach (KeyValuePair<string, List<IRegressionSolution>> solutions in resultSolutions) { 396 var problemDataClone = (IRegressionProblemData)Problem.ProblemData.Clone(); 397 problemDataClone.TrainingPartition.Start = SamplesStart.Value; problemDataClone.TrainingPartition.End = SamplesEnd.Value; 398 problemDataClone.TestPartition.Start = SamplesStart.Value; problemDataClone.TestPartition.End = SamplesEnd.Value; 399 var ensembleSolution = new RegressionEnsembleSolution(solutions.Value.Select(x => x.Model), problemDataClone, 400 solutions.Value.Select(x => x.ProblemData.TrainingPartition), 401 solutions.Value.Select(x => x.ProblemData.TestPartition)); 402 403 aggregatedResults.Add(new Result(solutions.Key, ensembleSolution)); 404 } 405 return aggregatedResults; 378 406 } 379 407 -
branches/histogram/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/LinearDiscriminantAnalysis.cs
r6011 r6195 68 68 string targetVariable = problemData.TargetVariable; 69 69 IEnumerable<string> allowedInputVariables = problemData.AllowedInputVariables; 70 int samplesStart = problemData.TrainingPartition.Start; 71 int samplesEnd = problemData.TrainingPartition.End; 72 IEnumerable<int> rows = Enumerable.Range(samplesStart, samplesEnd - samplesStart); 70 IEnumerable<int> rows = problemData.TrainingIndizes; 73 71 int nClasses = problemData.ClassNames.Count(); 74 72 double[,] inputMatrix = AlglibUtil.PrepareInputMatrix(dataset, allowedInputVariables.Concat(new string[] { targetVariable }), rows); -
branches/histogram/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/LinearRegression.cs
r6011 r6195 72 72 string targetVariable = problemData.TargetVariable; 73 73 IEnumerable<string> allowedInputVariables = problemData.AllowedInputVariables; 74 int samplesStart = problemData.TrainingPartition.Start; 75 int samplesEnd = problemData.TrainingPartition.End; 76 IEnumerable<int> rows = Enumerable.Range(samplesStart, samplesEnd - samplesStart); 74 IEnumerable<int> rows = problemData.TrainingIndizes; 77 75 double[,] inputMatrix = AlglibUtil.PrepareInputMatrix(dataset, allowedInputVariables.Concat(new string[] { targetVariable }), rows); 78 76 if (inputMatrix.Cast<double>().Any(x => double.IsNaN(x) || double.IsInfinity(x))) -
branches/histogram/HeuristicLab.Algorithms.DataAnalysis/3.4/SupportVectorMachine/SupportVectorClassification.cs
r5914 r6195 122 122 Dataset dataset = problemData.Dataset; 123 123 string targetVariable = problemData.TargetVariable; 124 int start = problemData.TrainingPartition.Start; 125 int end = problemData.TrainingPartition.End; 126 IEnumerable<int> rows = Enumerable.Range(start, end - start); 124 IEnumerable<int> rows = problemData.TrainingIndizes; 127 125 128 126 //extract SVM parameters from scope and set them -
branches/histogram/HeuristicLab.Algorithms.DataAnalysis/3.4/SupportVectorMachine/SupportVectorRegression.cs
r5914 r6195 130 130 Dataset dataset = problemData.Dataset; 131 131 string targetVariable = problemData.TargetVariable; 132 int start = problemData.TrainingPartition.Start; 133 int end = problemData.TrainingPartition.End; 134 IEnumerable<int> rows = Enumerable.Range(start, end - start); 132 IEnumerable<int> rows = problemData.TrainingIndizes; 135 133 136 134 //extract SVM parameters from scope and set them -
branches/histogram/HeuristicLab.Algorithms.DataAnalysis/3.4/kMeans/KMeansClustering.cs
r6011 r6195 85 85 Dataset dataset = problemData.Dataset; 86 86 IEnumerable<string> allowedInputVariables = problemData.AllowedInputVariables; 87 int start = problemData.TrainingPartition.Start; 88 int end = problemData.TrainingPartition.End; 89 IEnumerable<int> rows = Enumerable.Range(start, end - start); 87 IEnumerable<int> rows = problemData.TrainingIndizes; 90 88 int info; 91 89 double[,] centers;
Note: See TracChangeset
for help on using the changeset viewer.