How can I disable "Optimize Numeric Parameters" in gaussian process regression?
이전 댓글 표시
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
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
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
카테고리
도움말 센터 및 File Exchange에서 Gaussian Process Regression에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!