Changeset 11545
- Timestamp:
- 11/12/14 19:46:50 (10 years ago)
- Location:
- trunk/sources/HeuristicLab.Tests/Test Resources/Script Sources
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Tests/Test Resources/Script Sources/GridSearch_SVM_Classification_Script.cs
r11514 r11545 41 41 { "gamma", ValueGenerator.GenerateSteps(-4m, -1, 1).Select(x => Math.Pow(2,(double)x)) }, 42 42 // { "eps", ValueGenerator.GenerateSteps(-8m, -1, 1).Select(x => Math.Pow(2, (double)x)) }, 43 // { "nu" , ValueGenerator.GenerateSteps(0m, 1, 0.05m).Select(x => Math.Pow(2, (double)x)) },43 { "nu" , ValueGenerator.GenerateSteps(-10m, 0, 1m).Select(x => Math.Pow(2, (double)x)) }, 44 44 // { "degree", ValueGenerator.GenerateSteps(1m, 4, 1).Select(x => (double)x) } 45 45 }; … … 57 57 }; 58 58 59 private static SupportVectorClassificationSolution SvmGridSearch(IClassificationProblemData problemData, out svm_parameter bestParameters, out int nSv ) {60 bestParameters = SupportVectorMachineUtil.GridSearch( problemData, svmParameterRanges, numberOfFolds, shuffleFolds, maximumDegreeOfParallelism);59 private static SupportVectorClassificationSolution SvmGridSearch(IClassificationProblemData problemData, out svm_parameter bestParameters, out int nSv, out double cvMse) { 60 bestParameters = SupportVectorMachineUtil.GridSearch(out cvMse, problemData, svmParameterRanges, numberOfFolds, shuffleFolds, maximumDegreeOfParallelism); 61 61 double trainingError, testError; 62 62 string svmType = svmTypes[bestParameters.svm_type]; … … 81 81 82 82 int nSv; // number of support vectors 83 double cvMse; 83 84 svm_parameter bestParameters; 84 var bestSolution = SvmGridSearch(problemData, out bestParameters, out nSv );85 var bestSolution = SvmGridSearch(problemData, out bestParameters, out nSv, out cvMse); 85 86 86 87 vars["bestSolution"] = bestSolution; … … 103 104 } 104 105 } 106 -
trunk/sources/HeuristicLab.Tests/Test Resources/Script Sources/GridSearch_SVM_Regression_Script.cs
r11514 r11545 38 38 { "svm_type", new List<double> {svm_parameter.NU_SVR } }, 39 39 { "kernel_type", new List<double> { svm_parameter.RBF }}, 40 { "C", ValueGenerator.GenerateSteps(-1m, 1 0, 1).Select(x => Math.Pow(2, (double)x)) },40 { "C", ValueGenerator.GenerateSteps(-1m, 12, 1).Select(x => Math.Pow(2, (double)x)) }, 41 41 { "gamma", ValueGenerator.GenerateSteps(-4m, -1, 1).Select(x => Math.Pow(2, (double)x)) }, 42 42 // { "eps", ValueGenerator.GenerateSteps(-8m, -1, 1).Select(x => Math.Pow(2, (double)x)) }, 43 // { "nu" , ValueGenerator.GenerateSteps(0m, 1, 0.05m).Select(x => Math.Pow(2, (double)x)) },43 { "nu" , ValueGenerator.GenerateSteps(-10m, 0, 1m).Select(x => Math.Pow(2, (double)x)) }, 44 44 // { "degree", ValueGenerator.GenerateSteps(1m, 4, 1).Select(x => (double)x) } 45 45 }; … … 57 57 }; 58 58 59 private static SupportVectorRegressionSolution SvmGridSearch(IRegressionProblemData problemData, out svm_parameter bestParameters, out int nSv ) {60 bestParameters = SupportVectorMachineUtil.GridSearch( problemData, svmParameterRanges, numberOfFolds, shuffleFolds, maximumDegreeOfParallelism);59 private static SupportVectorRegressionSolution SvmGridSearch(IRegressionProblemData problemData, out svm_parameter bestParameters, out int nSv, out double cvMse) { 60 bestParameters = SupportVectorMachineUtil.GridSearch(out cvMse, problemData, svmParameterRanges, numberOfFolds, shuffleFolds, maximumDegreeOfParallelism); 61 61 double trainingError, testError; 62 62 string svmType = svmTypes[bestParameters.svm_type]; … … 81 81 82 82 int nSv; // number of support vectors 83 double cvMse; 83 84 svm_parameter bestParameters; 84 var bestSolution = SvmGridSearch(problemData, out bestParameters, out nSv );85 var bestSolution = SvmGridSearch(problemData, out bestParameters, out nSv, out cvMse); 85 86 86 87 vars["bestSolution"] = bestSolution; … … 104 105 } 105 106 } 107
Note: See TracChangeset
for help on using the changeset viewer.