【问题标题】:Decision Tree and Feature Importance: Why does the decision tree not show the importance of all variables?决策树和特征重要性:为什么决策树没有显示所有变量的重要性?
【发布时间】:2020-02-07 21:00:55
【问题描述】:

我运行了一个包含 62 个独立变量的决策树来预测股票价格。但是,当使用classifier_DT_tuned$variable.importance 提取特征重要性时,我只看到了 55 个变量的重要性,而没有看到 62 个变量的重要性。

我原以为决策树会选择最重要的变量,但随后会为未使用的变量分配 0.00 的重要性。你能帮我解释一下这个问题吗?谢谢!

【问题讨论】:

    标签: r decision-tree feature-selection


    【解决方案1】:

    您是否尝试过获得如下特征重要性:

    feat_importance = list(dt_clf.tree_.compute_feature_importances())
    

    这将为您提供所有 62 个特征/变量的重要性列表。

    【讨论】:

      猜你喜欢
      • 2016-03-18
      • 2023-03-15
      • 2018-08-16
      • 2019-01-11
      • 2015-08-13
      • 2018-04-16
      • 2018-09-17
      • 2012-07-19
      相关资源
      最近更新 更多