- Timestamp:
- 10/14/14 09:59:45 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/SupportVectorMachine/SupportVectorMachineUtil.cs
r11427 r11464 34 34 namespace HeuristicLab.Algorithms.DataAnalysis { 35 35 public class SupportVectorMachineUtil { 36 private static readonly object locker = new object();37 38 39 36 /// <summary> 40 37 /// Transforms <paramref name="problemData"/> into a data structure as needed by libSVM. … … 101 98 var setters = parameterRanges.Keys.Select(GenerateSetter).ToList(); 102 99 var partitions = GenerateSvmPartitions(problemData, numberOfFolds, shuffleFolds); 100 101 var locker = new object(); // for thread synchronization 103 102 Parallel.ForEach(crossProduct, new ParallelOptions { MaxDegreeOfParallelism = maxDegreeOfParallelism }, 104 103 parameterCombination => { … … 144 143 var testRows = folds[i]; 145 144 var trainingSvmProblem = CreateSvmProblem(problemData.Dataset, targetVariable, problemData.AllowedInputVariables, trainingRows); 146 var testSvmProblem = CreateSvmProblem(problemData.Dataset, targetVariable, problemData.AllowedInputVariables, testRows); 147 partitions[i] = new Tuple<svm_problem, svm_problem>(trainingSvmProblem, testSvmProblem); 145 var rangeTransform = RangeTransform.Compute(trainingSvmProblem); 146 var testSvmProblem = rangeTransform.Scale(CreateSvmProblem(problemData.Dataset, targetVariable, problemData.AllowedInputVariables, testRows)); 147 partitions[i] = new Tuple<svm_problem, svm_problem>(rangeTransform.Scale(trainingSvmProblem), testSvmProblem); 148 148 } 149 149 return partitions;
Note: See TracChangeset
for help on using the changeset viewer.