MATLAB Answers

How to use Gaussian Process Regression with multidimension and covSEard?

조회 수: 13(최근 30일)
Weam
Weam 2013년 2월 23일
답변: Cameron LaMack 2021년 9월 1일
How to use Gaussian Process Regression with multidimension and covSEard?
I have downloaded the Gaussian Processes for Machine Learning (GPML) package (gpml-matlab-v3.2-2013-01-15.zip) from the website. The demo_regression for one dimension works just fine in the matlab.
Now I have my own data for regression where the x (input) matrix is a 86x13 matrix (86 samples, 13 input vars), and the y (target) vector is 86x1. training data (58x13), test data(28x13), training target(58x1), test target(28x1)
The problem is that I do not understand hov to calculate the covfunc (covSEard), the code provided for the regression example does not work for multiple input datasets.
And the covSEiso works very well but I want to use covSEard because it is the best.
This is the error which appeared to me when I run the code:
.........................................................................
Error using eval Undefined function or variable 'D'.
Error in gpr (line 38) nhyp(i) = eval(feval(cov{2}{i}));
Error in minimize (line 75) [f0 df0] = feval(f, X, varargin{:}); % get function value and gradient
Error in GPR14_features_week5 (line 64) [logtheta0, fvals, iter] = minimize(logtheta0, 'gpr', -100, covfunc, NTData, NTargetT);
.....................................................................
Are there anybody who has tried this, and maybe can show an example?

답변(1개)

Cameron LaMack
Cameron LaMack 2021년 9월 1일
Hey there!
Hopefully you've had this question answered, but I saw that this has had a few views in the past 30 days so I thought I'd give an answer. So it's hard to tell without looking at your actual code, but the gpml toolbox is actually very friendly. It should be as easy as switching your covfunction from covSEiso to covSEard. The one thing you have to remember to do (which, based on the error, didn't end up happening), is initialize your hyperparameters to the correct size. It looks like you still only have 2 hyperparameters, which is fair, it's what the example problem has.
Rather you need 14 hyperparameters: 13 length scales for your input space of 13, and then one extra for signal variance (sf2).
Hope this helps whoever looks at this!

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by