How do I replace the "classregtree" class and "eval" function in R2018a onwards?
2 次查看(过去 30 天)
显示 更早的评论
MathWorks Support Team
2018-6-14
编辑: MathWorks Support Team
2024-9-16
I used to use 'eval' in MATLAB R2017b, but this triggers an error in R2018a. I have looked in the documentation, but found no solution. Can you help ?
Error using eval
Too many input arguments.
采纳的回答
MathWorks Support Team
2024-9-16
编辑:MathWorks Support Team
2024-9-16
That "eval" function was a method of the "classregtree" class which was removed in MATLAB R2018a. I noticed that you are now using the "fitctree" method instead of the removed "classregtree".
The trees from "fitctree" are part of the "ClassificationTree" class. A similar method to "eval" is in that class. It is called- "predict" and it predicts labels using classification tree. The third input in "predict" is slightly different than "eval", so you would need to change the inputs slightly.
Instead of:
>> eval(T, X, s)
The "predict" function should be used with the 'Subtrees' Name-Value pair.
>> predict(T, X, 'Subtrees', s);
For more information on the "ClassificationTree" class and the "predict" function, see the documentation links below:
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Language Support 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!