How to create consistent kernel parameters in Gaussian Process Regression (GPR) model with fitrgp

2 views (last 30 days)
I'm currently trying to generate a GP model using the fitrgp function, but I've noticed that the kernel parameters seem to change everytime I run the program. In otherwords, the model does not produce consistent kernel parameters which affects the accuracy of the model I am trying to create. I applied to following initial kernel parameters, but I'm still not sure how to create the model such that I can control the final kernel parameters. Any suggestions?
kparams = [1.4992, 0.481, 1.1305, 0.4737, 0.1069, 8.3483, 0.4629, 0.0587].* 1000;
gprMdl = fitrgp(X, y ,'KernelFunction', 'ardmatern52','KernelParameters', kparams, ...
'FitMethod','sr','PredictMethod','fic')
  1 Comment
Sahil Jain
Sahil Jain on 2 Sep 2021
Hi. I'm unable to reproduce this issue using the simple example on the Gaussian Process Regression Models page. Would it be possible for you to upload your data or maybe reproduce this issue on a sample dataset? The only time the kernel parameters seem to change from run-to-run is when the 'OptimizerHyperparameters' option is not set to 'none'. You could also try setting the random seed by running "rng('default')" at the beginning of your script to get reproducible results in case your GPR settings use randomizations at any place.

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!