Changeset 11677 for branches/ALPS/HeuristicLab.Algorithms.DataAnalysis
- Timestamp:
- 12/10/14 10:31:41 (10 years ago)
- Location:
- branches/ALPS
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ALPS
-
branches/ALPS/HeuristicLab.Algorithms.DataAnalysis
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Algorithms.DataAnalysis (added) merged: 11542,11623
- Property svn:mergeinfo changed
-
branches/ALPS/HeuristicLab.Algorithms.DataAnalysis/3.4/HeuristicLab.Algorithms.DataAnalysis-3.4.csproj
r11317 r11677 20 20 <StartupObject> 21 21 </StartupObject> 22 <TargetFrameworkVersion>v4. 0</TargetFrameworkVersion>22 <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> 23 23 <TargetFrameworkProfile> 24 24 </TargetFrameworkProfile> … … 48 48 <WarningLevel>4</WarningLevel> 49 49 <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> 50 <Prefer32Bit>false</Prefer32Bit> 50 51 </PropertyGroup> 51 52 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> … … 59 60 </DocumentationFile> 60 61 <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> 62 <Prefer32Bit>false</Prefer32Bit> 61 63 </PropertyGroup> 62 64 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> … … 68 70 <ErrorReport>prompt</ErrorReport> 69 71 <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> 72 <Prefer32Bit>false</Prefer32Bit> 70 73 </PropertyGroup> 71 74 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> … … 79 82 <ErrorReport>prompt</ErrorReport> 80 83 <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> 84 <Prefer32Bit>false</Prefer32Bit> 81 85 </PropertyGroup> 82 86 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> … … 88 92 <ErrorReport>prompt</ErrorReport> 89 93 <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> 94 <Prefer32Bit>false</Prefer32Bit> 90 95 </PropertyGroup> 91 96 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' "> … … 99 104 <ErrorReport>prompt</ErrorReport> 100 105 <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> 106 <Prefer32Bit>false</Prefer32Bit> 101 107 </PropertyGroup> 102 108 <ItemGroup> -
branches/ALPS/HeuristicLab.Algorithms.DataAnalysis/3.4/SupportVectorMachine/SupportVectorMachineUtil.cs
r11464 r11677 92 92 } 93 93 94 public static svm_parameter GridSearch( IDataAnalysisProblemData problemData, Dictionary<string, IEnumerable<double>> parameterRanges, int numberOfFolds, bool shuffleFolds = true, int maxDegreeOfParallelism = 1) {94 public static svm_parameter GridSearch(out double cvMse, IDataAnalysisProblemData problemData, Dictionary<string, IEnumerable<double>> parameterRanges, int numberOfFolds, bool shuffleFolds = true, int maxDegreeOfParallelism = 1) { 95 95 DoubleValue mse = new DoubleValue(Double.MaxValue); 96 96 var bestParam = DefaultParameters(); … … 108 108 109 109 double testMse = CalculateCrossValidationPartitions(partitions, parameters); 110 lock (locker) { 111 if (testMse < mse.Value) { 112 mse.Value = testMse; 113 bestParam = (svm_parameter)parameters.Clone(); 110 if (!double.IsNaN(testMse)) { 111 lock (locker) { 112 if (testMse < mse.Value) { 113 mse.Value = testMse; 114 bestParam = (svm_parameter)parameters.Clone(); 115 } 114 116 } 115 117 } 116 118 }); 119 cvMse = mse.Value; 117 120 return bestParam; 118 121 } … … 128 131 for (int i = 0; i < testSvmProblem.l; ++i) 129 132 calc.Add(testSvmProblem.y[i], svm.svm_predict(model, testSvmProblem.x[i])); 130 avgTestMse += calc.MeanSquaredError; 133 double mse = calc.ErrorState == OnlineCalculatorError.None ? calc.MeanSquaredError : double.NaN; 134 avgTestMse += mse; 131 135 } 132 136 avgTestMse /= partitions.Length;
Note: See TracChangeset
for help on using the changeset viewer.