Borrar filtros
Borrar filtros

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

23 visualizaciones (últimos 30 días)
JP Norair
JP Norair el 11 de Jul. de 2024 a las 12:34
Respondida: Divyam el 15 de Jul. de 2024 a las 5:54
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 comentario
Umar
Umar el 12 de Jul. de 2024 a las 1:21
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.

Iniciar sesión para comentar.

Respuestas (1)

Divyam
Divyam el 15 de Jul. de 2024 a las 5:54
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

Categorías

Más información sobre Statistics and Machine Learning Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by