Why my fitglm() function ignore the 'Options' input?
70 views (last 30 days)
Show older comments
Ziyue
on 15 Oct 2024 at 6:10
Commented: Cris LaPierre
on 17 Oct 2024 at 19:46
% Initialize the predictors
predictor1 = normrnd(0,200,225,40);
predictor2 = normrnd(100,200,225,40);
predictor = [predictor1;predictor2];
% Initialize the response
outcome = [repmat(0,225,1); repmat(1,225,1)];
% Set the options
options = statset('fitglm');
options.MaxIter = 1000;
options.Display = 'iter';
mdl = fitglm(predictor, outcome, "Distribution", "binomial",'Options',options);
However these fitglm completely ignored the options I changed. I am running Matlab in version "23.2.0.2485118 (R2023b) Update 6" and Statistics and Machine learning toolbox in version 23.2.
P.S.: I have seen 'Options' in the function script of fitglm in my matlab, but cannot see it with automatic fullfil when I wrote the fitglm line.
Many thanks for the help!
edit:
I have changed options.Display = 'final', but still nothing was displayed.
6 Comments
Aquatris
on 15 Oct 2024 at 13:36
Looks like showing all the iterations is not supported for fitglm function as shown by @Cris LaPierre's answer.
Accepted Answer
Cris LaPierre
on 15 Oct 2024 at 13:16
Note that fitglm does not appear to support the 'iter' option. Looking at the documentation, the options listed for Display are 'off' or 'final'.
9 Comments
Cris LaPierre
on 17 Oct 2024 at 19:46
I have learned that the documentation is incorrect. fitglm does not support the 'Display' option at all. The documentation will be updated to remove reference to it.
More Answers (0)
See Also
Categories
Find more on MATLAB Report Generator 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!