【问题标题】:Interpreting Decision Tree in Python用 Python 解释决策树
【发布时间】:2019-01-14 07:28:12
【问题描述】:

我在 python 中构建了一个决策树,但我正在努力解释它。树如下图所示。

这是流失模型的结果。我想知道如何解释以下内容:

  1. Number of children at home <=3.5  (Integer)
  2. MaritalStatus_M <= 0.5  (M- Married in here and was a binary. I was expecting either MaritalStatus_M=0 or =1)
  3. Sales Reason_Price<=0.5 (Binary. I was expecting either Sales Reason_Price=0 or =1)
  4. Tenure_Months<= 0.5 (Integer)

【问题讨论】:

    标签: python machine-learning scikit-learn decision-tree


    【解决方案1】:

    树中的拆分决策更喜欢&lt;= 关系有一些内部原因(而不是平等,即使后者似乎对人类读者更有意义),但是这样的表示细节不应该对解释造成任何困难,这就是您在此处询问的内容。

    所以,实际上:

    1. children &lt;= 3.5 表示less than four children(假设变量为整数)
    2. MaritalStatus_M &lt;= 0.5 对于二进制变量意味着 MaritalStatus_M==0(即not married
    3. Sales Reason_Price&lt;=0.5 对于二进制变量意味着 Sales Reason_Price==0
    4. Tenure_Months&lt;= 0.5 表示Tenure_Months==0(假设变量为整数)

    【讨论】:

    • 感谢您的回答,Tenure_months 是整数。一旦我得到“Tenure_Months
    • @L.G.是的,应该是Tenure_Months &lt; 21Tenure_Months &lt;= 20(翻译成同一个东西)
    • 如果一个变量在一个分支中出现多次,我将如何解释?在图片中是 MIN_TXN_VALUE,橙色,类 Not_Churn。请阅读 MIN_TXN_VALUE 作为最低交易价值
    • @L.G.请在阅读树时尝试应用一些常识(据说树对此特别有用)。看不出你的意思——我能看到的唯一橙色Not_churn叶子大约是MAX_TXN_VALUE,而不是MIN;从MIN_TXN_VALUE &lt;= 21.735True 的分支继续到MIN_TXN_VALUE &lt;= 4.49(这并不矛盾),对于True,它最终到MAX_TXN_VALUE &lt;= 4.49,这又与之前的节点不矛盾
    猜你喜欢
    • 2014-06-15
    • 2019-11-19
    • 2016-08-21
    • 1970-01-01
    • 2014-06-26
    • 1970-01-01
    • 1970-01-01
    • 2018-06-13
    • 2020-02-02
    相关资源
    最近更新 更多