Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/10/14 10:31:41 (10 years ago)
Author:
pfleck
Message:

#2269 Merged trunk. Updated .net version of ALPS plugin.

Location:
branches/ALPS
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/ALPS

  • branches/ALPS/HeuristicLab.Algorithms.DataAnalysis

  • branches/ALPS/HeuristicLab.Algorithms.DataAnalysis/3.4/HeuristicLab.Algorithms.DataAnalysis-3.4.csproj

    r11317 r11677  
    2020    <StartupObject>
    2121    </StartupObject>
    22     <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
     22    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
    2323    <TargetFrameworkProfile>
    2424    </TargetFrameworkProfile>
     
    4848    <WarningLevel>4</WarningLevel>
    4949    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
     50    <Prefer32Bit>false</Prefer32Bit>
    5051  </PropertyGroup>
    5152  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     
    5960    </DocumentationFile>
    6061    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
     62    <Prefer32Bit>false</Prefer32Bit>
    6163  </PropertyGroup>
    6264  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
     
    6870    <ErrorReport>prompt</ErrorReport>
    6971    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
     72    <Prefer32Bit>false</Prefer32Bit>
    7073  </PropertyGroup>
    7174  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
     
    7982    <ErrorReport>prompt</ErrorReport>
    8083    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
     84    <Prefer32Bit>false</Prefer32Bit>
    8185  </PropertyGroup>
    8286  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
     
    8892    <ErrorReport>prompt</ErrorReport>
    8993    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
     94    <Prefer32Bit>false</Prefer32Bit>
    9095  </PropertyGroup>
    9196  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
     
    99104    <ErrorReport>prompt</ErrorReport>
    100105    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
     106    <Prefer32Bit>false</Prefer32Bit>
    101107  </PropertyGroup>
    102108  <ItemGroup>
  • branches/ALPS/HeuristicLab.Algorithms.DataAnalysis/3.4/SupportVectorMachine/SupportVectorMachineUtil.cs

    r11464 r11677  
    9292    }
    9393
    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) {
    9595      DoubleValue mse = new DoubleValue(Double.MaxValue);
    9696      var bestParam = DefaultParameters();
     
    108108
    109109        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            }
    114116          }
    115117        }
    116118      });
     119      cvMse = mse.Value;
    117120      return bestParam;
    118121    }
     
    128131        for (int i = 0; i < testSvmProblem.l; ++i)
    129132          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;
    131135      }
    132136      avgTestMse /= partitions.Length;
Note: See TracChangeset for help on using the changeset viewer.