optimizing GPR model using genetic algorithm
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
As I tried to optimize the hyperparameters and sigma using GA, it is showing some error. Also, is it possible to limit the maximum
objective evaluations or put lb/ub on GA optimization? Please help.
clear;clc;close all
load('data001.mat')
x=data001(:,1);
y=data001(:,2);
kernel = optimizableVariable('KernelFunction',{'exponential','squaredexponential','matern32','matern52',...
'rationalquadratic','ardexponential','ardsquaredexponential','ardmatern32','ardmatern52','ardrationalquadratic'},...
'Type','categorical');
sigma = optimizableVariable('Sigma',[1e-4,10],'Transform','log');
go = ga(@objFcn,2) % calling objective function in optimization algorithm
kernel= go.XAtMinObjective.KernelFunction
model = fitrgp(x,y, 'KernelFunction', char(kernel));
yfit = predict(model, x);
function Loss = objFcn(Vars, x, y)
m = fitrgp(x, y, 'KernelFunction', char(Vars.KernelFunction), ...
'Sigma', Vars.Sigma, 'ConstantSigma', true,...
'KFold', 5);
Loss = kfoldLoss(m);
end
1 comentario
Alan Weiss
el 11 de Jul. de 2022
Editada: Alan Weiss
el 11 de Jul. de 2022
You asked this question elsewhere. See my answer here: https://www.mathworks.com/matlabcentral/answers/1754650-changing-optimization-technique-for-gaussian-process-regression-model?s_tid=srchtitle
Alan Weiss
MATLAB mathematical toolbox documentation
Respuestas (0)
Ver también
Categorías
Más información sobre Gaussian Process Regression 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!