Changeset 14888 for branches/RBFRegression/HeuristicLab.Algorithms.DataAnalysis/3.4/KernelRidgeRegression/KernelRidgeRegression.cs
- Timestamp:
- 04/25/17 09:42:18 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/RBFRegression/HeuristicLab.Algorithms.DataAnalysis/3.4/KernelRidgeRegression/KernelRidgeRegression.cs
r14887 r14888 115 115 116 116 protected override void Run(CancellationToken cancellationToken) { 117 double rmsError ;117 double rmsError, looCvRMSE; 118 118 var kernel = Kernel; 119 119 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); 121 121 Results.Add(new Result(SolutionResultName, "The kernel ridge regression solution.", solution)); 122 122 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))); 123 124 } 124 125 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) { 126 127 var model = new KernelRidgeRegressionModel(problemData.Dataset, problemData.TargetVariable, problemData.AllowedInputVariables, problemData.TrainingIndices, scaleInputs, kernel, lambda); 127 128 rmsError = double.NaN; … … 134 135 solution.Model.Name = "Kernel ridge regression model"; 135 136 solution.Name = SolutionResultName; 137 looCvRMSE = model.LooCvRMSE; 136 138 return solution; 137 139 }
Note: See TracChangeset
for help on using the changeset viewer.