validate.rpart(rms)
validate.rpart()所属R语言包:rms
Dxy and Mean Squared Error by Cross-validating a Tree Sequence
美元指数和均方误差的交叉验证树序列
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Uses xval-fold cross-validation of a sequence of trees to derive estimates of the mean squared error and Somers' Dxy rank correlation between predicted and observed responses. In the case of a binary response variable, the mean squared error is the Brier accuracy score. There are print and plot methods for objects created by validate.rpart.
使用xval倍交叉验证序列的树木估计值的均方误差和萨默斯Dxy排名之间的相关性预测和观察到的反应。在一个二进制响应变量的情况下,均方误差是石南木准确性得分。有print和plot方法创建的对象的validate.rpart。
用法----------Usage----------
# f <- rpart(formula=y ~ x1 + x2 + \dots) # or rpart
## S3 method for class 'rpart'
validate(fit, method, B, bw, rule, type, sls, aics,
force, pr=TRUE,
k, rand, xval=10, FUN, ...)
## S3 method for class 'validate.rpart'
print(x, ...)
## S3 method for class 'validate.rpart'
plot(x, what=c("mse","dxy"), legendloc=locator, ...)
参数----------Arguments----------
参数:fit
an object created by rpart. You must have specified the model=TRUE argument to rpart.
创建的对象rpart。您必须指定model=TRUE参数rpart。
参数:method,B,bw,rule,type,sls,aics,force
are there only for consistency with the generic validate function; these are ignored
有只为与通用validate功能的一致性;这些被忽略
参数:x
the result of validate.rpart
结果validate.rpart
参数:k
a sequence of cost/complexity values. By default these are obtained from calling FUN with no optional arguments or from the rpart cptable object in the original fit object. You may also specify a scalar or vector.
成本/复杂性值的一个序列。默认情况下,这些调用FUN不带可选的参数,或从rpartcptable对象在原合适的对象。你也可以指定一个标量或矢量。
参数:rand
a random sample (usually omitted)
一个随机样本(通常省略)
参数:xval
number of splits
分割数
参数:FUN
the name of a function which produces a sequence of trees, such prune.
一个函数,它产生一个序列的树木,例如prune的名称。
参数:...
additional arguments to FUN (ignored by print,plot).
其他参数FUN(忽略的print,plot)。
参数:pr
set to FALSE to prevent intermediate results for each k to be printed
设置为FALSE防止中间结果为每一个k要打印
参数:what
a vector of things to plot. By default, 2 plots will be done, one for mse and one for Dxy.
来绘制一个矢量的事情。默认情况下,将2图完成后,为mse和一个用于Dxy。
参数:legendloc
a function that is evaluated with a single argument equal to 1 to generate a list with components x, y specifying coordinates of the upper left corner of a legend, or a 2-vector. For the latter, legendloc specifies the relative fraction of the plot at which to center the legend.
一个函数,一个参数等于1生成一个列表的组件进行评估x, y指定左上角的一个传奇,一个向量的坐标。对于后者,legendloc指定相对小部分的图在中心的传奇。
值----------Value----------
a list of class "validate.rpart" with components named k, size, dxy.app, dxy.val, mse.app, mse.val, binary, xval. size is the number of nodes, dxy refers to Somers' D, mse refers to mean squared error of prediction, app means apparent accuracy on training samples, val means validated accuracy on test samples, binary is a logical variable indicating whether or not the response variable was binary (a logical or 0/1 variable is binary). size will not be present if the user specifies k.
的列表类"validate.rpart"的组件名为k, size, dxy.app,dxy.val, mse.app, mse.val, binary, xval。 size节点的数量,dxy是指萨默斯的D,mse是指均方误差的预测,app是指明显的准确度对训练样本,val装置验证测试样本上的准确性,binary表示是否响应变量是二进制(逻辑或0/1的变量是二进制的)是一个逻辑变量。 size不会出现如果用户指定k,。
副作用----------Side Effects----------
prints if pr=TRUE
如果pr=TRUE打印
(作者)----------Author(s)----------
Frank Harrell
<br>
Department of Biostatistics
<br>
Vanderbilt University
<br>
f.harrell@vanderbilt.edu
参见----------See Also----------
rpart, somers2, rcorr.cens, locator, legend
rpart,somers2,rcorr.cens,locator,legend
实例----------Examples----------
## Not run: [#不运行:]
n <- 100
set.seed(1)
x1 <- runif(n)
x2 <- runif(n)
x3 <- runif(n)
y <- 1*(x1+x2+rnorm(n) > 1)
table(y)
require(rpart)
f <- rpart(y ~ x1 + x2 + x3, model=TRUE)
v <- validate(f)
v # note the poor validation[注意穷人的验证]
par(mfrow=c(1,2))
plot(v, legendloc=c(.2,.5))
par(mfrow=c(1,1))
## End(Not run)[#(不执行)]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|