Why my fitglm() function ignore the 'Options' input?

조회 수: 6 (최근 30일)
Ziyue
Ziyue 2024년 10월 15일
댓글: Cris LaPierre 2024년 10월 17일
% 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
Aquatris
Aquatris 2024년 10월 15일
Looks like showing all the iterations is not supported for fitglm function as shown by @Cris LaPierre's answer.
Ziyue
Ziyue 2024년 10월 15일
Thank you for noticing! I have changed it, but still nothing appeared after I changed it to 'final'. Also, the max iteration is still 100 as default.

댓글을 달려면 로그인하십시오.

채택된 답변

Cris LaPierre
Cris LaPierre 2024년 10월 15일
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
Ziyue
Ziyue 2024년 10월 15일
Sure! I have reported it! Thank you so much!
Cris LaPierre
Cris LaPierre 2024년 10월 17일
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.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Report Generator에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by