stepwiselm: Can I limit the maximum number of variables to a fixed integer?
1 次查看(过去 30 天)
显示 更早的评论
I'm using stepwiselm:
stepwiselm(X,y,'constant','Upper','quadratic','Criterion','adjrsquared')
I want my model to include all kinds of linear terms, interactions, and squared terms, so I choose "'Upper','quadratic'". At the same time I would like my model not to include more than 10 variables altogether. E.g. the goal is to find those 10 terms from all kinds of possibilities that maximize the Criterion, e.g. adjrsquared. How can I implement this?
Thank you very much.
0 个评论
采纳的回答
Mukul Rao
2017-7-19
Hi,
I work for the MathWorks, and I believe what you are trying to accomplish is not currently supported by "stepwiselm". You can come close to this functionality by starting with a model containing only the constant term, and using the 'NSteps' option to limit the number of steps taken. That process may include terms being removed as well as entered, though, so this will not do exactly as requested.
There is an enhancement request in place and I will make sure to add your use case in the details.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Model Building and Assessment 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!