How to set arguments of 'fitrgp' while using 'bayesopt'?
4 views (last 30 days)
Show older comments
'bayesopt' uses 'fitrgp' to fit GP regression model. However, it seems that 'bayesopt' does not provide an interface to set the arguments of the inner 'fitrgp'. How can I set these arguments?
To be more specific, is it possible to force 'fitrpg' to use 'sr' as 'FitMethod' when using 'bayesopt'?
0 Comments
Accepted Answer
Don Mathis
on 23 Mar 2017
You're right that bayesopt doesn't provide an interface for that. If you're willing to modify a source code file it can be done pretty easily. Go to line 3118 of BayesianOptimization.m
>> edit BayesianOptimization.m
It's in the function 'iFitrgpRobust'. The line looks like this:
GP = compact(fitrgp(X, Y, varargin{:}, 'SigmaLowerBound', SigmaLowerBound));
You can then add arguments to the end of this argument list. Suppose you wanted to use fitmethod 'sd' with an active set size of 300. You could do this:
GP = compact(fitrgp(X, Y, varargin{:}, 'SigmaLowerBound', SigmaLowerBound, ...
'FitMethod', 'sd', 'ActiveSetSize', 300));
By the way, would you mind sharing your reason for wanting to do this? I have a guess but I would like to hear from you. Thanks.
2 Comments
Don Mathis
on 24 Mar 2017
That was my guess :-). Your solution is exactly what I would recommend -- Use SD and set the active set size to some value that is fast enough for your problem. That number will depend on your problem, so you'll need to adjust it for each problem. I have used this technique and I find it works well.
More Answers (0)
See Also
Categories
Find more on Model Building and Assessment 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!