【问题标题】:Random Forest in RR中的随机森林
【发布时间】:2014-01-14 02:46:42
【问题描述】:

如果x是R中的随机森林,例如,

x <- cforest (y~ a+b+c, data = football),

x[[9]] 是什么意思?

【问题讨论】:

    标签: r tree random-forest


    【解决方案1】:

    你不能对这个对象进行子集化,所以在某种意义上,x[[9]] 什么都不是,它本身是不可访问的。

    x 是 S4 类 "RandomForest-class" 的对象。此类记录在帮助页面?'RandomForest-class' 上。该对象的插槽在此处命名和描述。您也可以通过slotNames()获取插槽名称

    library("party")
    foo <- cforest(ME ~ ., data = mammoexp, control = cforest_unbiased(ntree = 50))
    
    > slotNames(foo)
     [1] "ensemble"            "where"               "weights"            
     [4] "initweights"         "data"                "responses"          
     [7] "cond_distr_response" "predict_response"    "prediction_weights" 
    [10] "get_where"           "update"
    

    如果 x[[9]] 指的是第 9 个插槽,那么这是 predict_weights?'RandomForest-class' 告诉我们这是

     ‘prediction_weights’: a function for extracting weights from
          terminal nodes.
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-05-04
      • 2018-01-18
      • 2015-10-19
      • 2020-02-25
      • 1970-01-01
      • 2021-10-12
      • 2016-06-24
      • 2012-10-27
      相关资源
      最近更新 更多