how to fix Iteration limit reached warning
32 次查看(过去 30 天)
显示 更早的评论
Dear All
I am using logistic regression . I have results using glmfit but with a warning message that "iteration limit is reached". I would like to increase this limit. How to do do that when I ask "glmfit" ? beside i have to say that i tried edit glmfit, line 284, and change itration from 100 to 10000 but it dose not work.
Thank you in advance
2 个评论
John D'Errico
2014-9-3
Editing MATLAB toolbox codes is almost always a bad idea unless you know enough about the tool to have written it yourself.
采纳的回答
Tom Lane
2014-9-12
This can be a symptom of perfect separation between the classes, or of something similar to perfect separation. Consider this:
>> x = [7 0;0 0;8 0;9 0;7 1;8 0;7 0;4 0;7 0;2 0];
>> y = [0 0 1 1 1 0 0 1 0 0]';
>> fitglm(x,y,'distr','binomial');
Warning: Iteration limit reached.
>> fitglm(x(:,2),y,'distr','binomial');
Warning: Iteration limit reached.
Warning: The estimated coefficients perfectly separate failures from successes. This means the theoretical best estimates are not
finite. For the fitted linear combination XB of the predictors, the sample proportions P of Y=N in the data satisfy:
XB=-0.693147: P=0.333333
XB>-0.693147: P=1
Here's a case where the iteration limit was met because the true parameter values are drifting off to infinity. In the second case, the function diagnosed the problem and tried to explain it. In the first case, the function was unable to diagnose the problem and just gave up.
I don't know if this is the case in your example. Do you see coefficients getting large so that x*b is big? I'd be willing to try to diagnose the problem if you want to send me your data.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Gaussian Process Regression 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!