How can I disable "Optimize Numeric Parameters" in gaussian process regression?
4 views (last 30 days)
Show older comments
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 Comment
Umar
on 12 Jul 2024
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.
Answers (1)
Divyam
on 15 Jul 2024
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
0 Comments
See Also
Categories
Find more on Statistics and Machine Learning Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!