1

我已经使用party. R树很好,但它非常大(27 个终端节点)。尝试打印它会导致文件不可读,椭圆形相互重叠。

我怎样才能创造出可读的东西?

我可以打印树的子部分吗?例如,前几个节点的第一页,然后从孙子节点开始的后续页面?

对于可视化这样的树还有其他建议吗?

编辑斯蒂芬要求一个可重复的例子;这是合理的,但在这里很难;变量的相互关系是存在一棵树的关键,而这些很难(至少对我来说!)模拟。此外,有些变量是分类的,有些是连续的。但这是在 R 中打印树结构的输出版本。(我用 V1 等代替变量名)

1) v1 == {AS, IT, LS, NS}; criterion = 1, statistic = 106.413
  2) v2 <= 0; criterion = 1, statistic = 37.039
    3) v1 == {NS}; criterion = 1, statistic = 34.458
      4)*  weights = 316 
    3) v1 == {AS, IT, LS}
      5) V3 <= 2; criterion = 1, statistic = 28.409
        6) V4 <= 0; criterion = 0.997, statistic = 15.053
          7) v5 == {A: Maste, B: Bache, C: Assoc}; criterion = 0.964, statistic = 15.43
            8) V6 <= 24.1068; criterion = 0.98, statistic = 11.242
              9)*  weights = 259 
            8) V6 > 24.1068
              10)*  weights = 886 
          7) v5 == {D: Plus2}
            11)*  weights = 38 
        6) V4 > 0
          12) V7 <= 0; criterion = 1, statistic = 22.142
            13)*  weights = 440 
          12) V7 > 0
            14) V8 <= 1; criterion = 0.999, statistic = 17.06
              15)*  weights = 88 
            14) V8 > 1
              16)*  weights = 59 
      5) V3 > 2
        17)*  weights = 100 
  2) v2 > 0
    18)*  weights = 41 
1) v1 == {, BM, CJ, HS}
  19) V4 <= 0; criterion = 1, statistic = 60.5
    20) V7 <= 0; criterion = 1, statistic = 41.949
      21) V9 <= 0; criterion = 0.985, statistic = 15.936
        22)*  weights = 376 
      21) V9 > 0
        23) V8 <= 1; criterion = 1, statistic = 30.046
          24) V10Wks <= 7.142857; criterion = 1, statistic = 19.078
            25) v11 <= 3.5738; criterion = 0.989, statistic = 12.966
              26)*  weights = 524 
            25) v11 > 3.5738
              27)*  weights = 853 
          24) V10Wks > 7.142857
            28)*  weights = 27 
        23) V8 > 1
          29) v12 <= 0; criterion = 1, statistic = 27.748
            30)*  weights = 38 
          29) v12 > 0
            31)*  weights = 88 
    20) V7 > 0
      32) V14 <= 0; criterion = 1, statistic = 25.564
        33) V8 <= 1; criterion = 0.98, statistic = 13.9
          34)*  weights = 115 
        33) V8 > 1
          35)*  weights = 48 
      32) V14 > 0
        36) V13 <= 2; criterion = 0.983, statistic = 11.504
          37)*  weights = 96 
        36) V13 > 2
          38)*  weights = 91 
  19) V4 > 0
    39) V8 <= 1; criterion = 1, statistic = 25.961
      40) V3 <= 0; criterion = 0.999, statistic = 17.093
        41) V14 <= 0; criterion = 0.965, statistic = 10.183
          42)*  weights = 127 
        41) V14 > 0
          43)*  weights = 480 
      40) V3 > 0
        44)*  weights = 172 
    39) V8 > 1
      45) v15 <= 0; criterion = 0.995, statistic = 14.604
        46) V9 <= 0; criterion = 0.987, statistic = 12.104
          47) v1 == {HS}; criterion = 1, statistic = 21.895
            48)*  weights = 43 
          47) v1 == {BM, CJ}
            49) v16 <= 0; criterion = 0.979, statistic = 15.049
              50)*  weights = 30 
            49) v16 > 0
              51)*  weights = 14 
        46) V9 > 0
          52)*  weights = 34 
      45) v15 > 0
        53)*  weights = 141 

我希望能对结构有所了解;很多节点!

默认情况下,plotinparty将每个拆分放在一个椭圆中,并为终端节点放置附加信息。但这不适合页面。

4

1 回答 1

1

您是否尝试过增加图像大小?我在这里概述了一个使用 partykit 包的示例,但它与派对包的工作方式相同(我使用了一段时间,直到我的数据集大小开始崩溃派对):

如何在从partykit 绘制 ctree 输出时抖动节点拆分字符串?

于 2014-10-18T01:30:51.123 回答