Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/25/17 09:42:18 (8 years ago)
Author:
gkronber
Message:

#2699: re-added calculation of leave one out cv estimate

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/RBFRegression/HeuristicLab.Algorithms.DataAnalysis/3.4/KernelRidgeRegression/KernelRidgeRegression.cs

    r14887 r14888  
    115115
    116116    protected override void Run(CancellationToken cancellationToken) {
    117       double rmsError;
     117      double rmsError, looCvRMSE;
    118118      var kernel = Kernel;
    119119      kernel.Beta = Beta;
    120       var solution = CreateRadialBasisRegressionSolution(Problem.ProblemData, kernel, Math.Pow(10, LogLambda), ScaleInputVariables, out rmsError);
     120      var solution = CreateRadialBasisRegressionSolution(Problem.ProblemData, kernel, Math.Pow(10, LogLambda), ScaleInputVariables, out rmsError, out looCvRMSE);
    121121      Results.Add(new Result(SolutionResultName, "The kernel ridge regression solution.", solution));
    122122      Results.Add(new Result("RMSE (test)", "The root mean squared error of the solution on the test set.", new DoubleValue(rmsError)));
     123      Results.Add(new Result("RMSE (LOO-CV)", "The leave-one-out-cross-validation root mean squared error", new DoubleValue(looCvRMSE)));
    123124    }
    124125
    125     public static IRegressionSolution CreateRadialBasisRegressionSolution(IRegressionProblemData problemData, ICovarianceFunction kernel, double lambda, bool scaleInputs, out double rmsError) {
     126    public static IRegressionSolution CreateRadialBasisRegressionSolution(IRegressionProblemData problemData, ICovarianceFunction kernel, double lambda, bool scaleInputs, out double rmsError, out double looCvRMSE) {
    126127      var model = new KernelRidgeRegressionModel(problemData.Dataset, problemData.TargetVariable, problemData.AllowedInputVariables, problemData.TrainingIndices, scaleInputs, kernel, lambda);
    127128      rmsError = double.NaN;
     
    134135      solution.Model.Name = "Kernel ridge regression model";
    135136      solution.Name = SolutionResultName;
     137      looCvRMSE = model.LooCvRMSE;
    136138      return solution;
    137139    }
Note: See TracChangeset for help on using the changeset viewer.