gpt4 book ai didi

matlab - 如何从classregtree中查找使用过的特征

转载 作者:行者123 更新时间:2023-11-30 09:13:21 25 4
gpt4 key购买 nike

我使用 MATLAB 中的 classregtree 函数对数据集进行了训练。训练的结果是,某些功能可能不会被使用。我想找出由 classregtree 创建的树使用的所有功能。

有什么函数可以做到这一点吗?

最佳答案

请参阅varimportance method .

imp = varimportance(t) computes estimates of input feature importance for tree t by summing changes in the risk due to splits on every feature. The returned vector imp has one element for each input variable in the data used to train this tree. At each node, the risk is estimated as node impurity if impurity was used to split nodes and node error otherwise. This risk is weighted by the node probability. Variable importance associated with this split is computed as the difference between the risk for the parent node and the total risk for the two children.

据我所知,零意味着未使用。您还可以使用view直观地看到树。

关于matlab - 如何从classregtree中查找使用过的特征,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19736500/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com