简体   繁体   English

随机森林(rfsrc 包):多元分析

[英]Random Forest (rfsrc package): multivariate analysis

I'm trying to evaluate interactions between promotions on child products.我正在尝试评估儿童产品促销之间的互动。 My dataset counts 1073 dicotomic variables ( x ) and 11 dependent ( y ).我的数据集包含 1073 个二元变量 ( x ) 和 11 个相关变量 ( y )。 I'm using rfsrc from randomForestSRC package in R.我使用rfsrcrandomForestSRC在河包

fit2=rfsrc(Multivar(y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11) ~.,data = data3, importance =TRUE)
err <- get.mv.error(fit2)
err
vmp.std <- get.mv.vimp(fit2, standardize = TRUE)
plot(fit2)

Why, by default, R give me back just y1 as response?为什么默认情况下,R 只给我y1作为响应?

                         Sample size: 602
                     Number of trees: 1000
           Forest terminal node size: 5
       Average no. of terminal nodes: 179.484
No. of variables tried at each split: 358
              Total no. of variables: 1073
              Total no. of responses: 11
         User has requested response: y1
       Resampling used to grow trees: swr
    Resample size used to grow trees: 602
                            Analysis: mRF-R
                              Family: regr+
                      Splitting rule: mv.mse *random*
       Number of random split points: 10
                % variance explained: 53.03
                          Error rate: 0.4

There are some command to plot some informations?有一些命令可以绘制一些信息吗?

If you look at the source code of plot.variable.rfsrc.R which is called to plot your randomForestSRC object, the default for m.target is NULL And it feeds this to another function get.univariate.target which will take the first variable.如果你看一下源代码plot.variable.rfsrc.R这就是所谓绘制你的randomForestSRC对象,默认m.targetNULL ,将其提供该另一个功能get.univariate.target将采取的第一个变量. If you want to plot other variables, you specify m.target=...如果要绘制其他变量,请指定m.target=...

library(mlr)
library(randomForestSRC)

yeast = getTaskData(yeast.task)
data = yeast[,c(1:3,15:100)]
head(data)
fit = rfsrc(Multivar(label1,label2,label3) ~.,data = data, importance =TRUE)

plot(fit,m.target="label2")

在此处输入图片说明

plot(fit,m.target="label3")

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM