How can I disable "Optimize Numeric Parameters" in gaussian process regression?

2 次查看(过去 30 天)
I'm performing a hyper-parameter optimization of a Gaussian Process Regression (GPR), and I've noticed that it runs in about 30 seconds in the Regression Learner App, but more like 70 seconds if I run a hopefully identical function in the workspace.
I've tried a lot of different settings in my custom function, but always it is much slower.
The only difference is that, in the learner app, there is an option called "Optimize Numeric Parameters" which, when set, makes the regression learner app run much more slowly (similar to function from workspace, if not even slower).
I find that the results are in fact superior with "Optimize Numeric Parameters" disabled, plus it runs much faster so I can do more iterations. How can I disable this in the function I wrote to train a GPR model?
  1 个评论
Umar
Umar 2024-7-12
Hi JP,
If I recall , you need to specify 'FitMethod' as 'none', this way you will be able to control the optimization process manually and disable the automatic optimization of numeric parameters in Gaussian Process Regression.

请先登录,再进行评论。

回答(1 个)

Divyam
Divyam 2024-7-15
Hi JP,
If you are using the "fitgrp" function, you can disable the numerical parameter optimization by setting the "FitMethod" as "none". Here is a sample code to help you with the same.
% Example code taken from: https://www.mathworks.com/help/stats/fitrgp.html#butnoh6-2
% Generating sample data
rng(0,'twister');
n = 1000;
x = linspace(-10,10,n)';
y = 1 + x*5e-2 + sin(x)./x + 0.2*randn(n,1);
% Fitting the GRP Model using the "FitMethod" set as "none"
% The "PredictMethod" can be altered as per your requirements
gprMdl = fitrgp(x,y,'Basis','linear','FitMethod','none','PredictMethod','exact');
To get more information about using the Gaussian Process Regression Model in MATLAB, refer to this documentation: https://www.mathworks.com/help/stats/regressiongp.html

类别

Help CenterFile Exchange 中查找有关 Gaussian Process Regression 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by