找回密码
 注册
查看: 4262|回复: 0

R语言:rpart()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-16 19:59:15 | 显示全部楼层 |阅读模式
rpart(rpart)
rpart()所属R语言包:rpart

                                         Recursive Partitioning and Regression Trees
                                         递归分割和回归树

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

Fit a rpart model
适合rpart模型


用法----------Usage----------


rpart(formula, data, weights, subset, na.action = na.rpart, method,
      model = FALSE, x = FALSE, y = TRUE, parms, control, cost, ...)



参数----------Arguments----------

参数:formula
a formula, with a response but no interaction terms.
与响应,但没有互动方面的公式。


参数:data
an optional data frame in which to interpret the variables named in the formula.  
在解释公式中的命名变量的可选的数据框。


参数:weights
optional case weights.
可选的情况下重量。


参数:subset
optional expression saying that only a subset of the rows of the data should be used in the fit.
可选的表达式说,只有一个数据行的一个子集,应适合使用。


参数:na.action
the default action deletes all observations for which y is missing, but keeps those in which one or more predictors are missing.
默认操作删除所有意见为y的丢失了,但一直缺少其中一个或多个预测。


参数:method
one of "anova", "poisson", "class" or "exp".  If method is missing then the routine tries to make an intelligent guess. If y is a survival object, then method="exp" is assumed, if y has 2 columns then method="poisson" is assumed, if y is a factor then method="class" is assumed, otherwise method="anova" is assumed. It is wisest to specify the method directly, especially as more criteria may added to the function in future.  Alternatively, method can be a list of functions named init, split and eval.  Examples are given in the file "tests/usersplits.R" in the sources.
一个"anova","poisson","class"或"exp"。 method如果缺少常规的尝试,做一个聪明的猜测。 y如果是一个生存的对象,那么method="exp"假设,如果y有2列,那么method="poisson"假设,如果y是一个因素,那么method="class"假设,否则method="anova"假设。这是最明智的直接指定的方法,特别是随着越来越多的标准可能在未来的功能添加到。另外,method可以是一个名为init,split和eval的功能列表。例子文件tests/usersplits.R来源。


参数:model
if logical: keep a copy of the model frame in the result? If the input value for model is a model frame (likely from an earlier call to the rpart function), then this frame is used rather than constructing new data.
如果逻辑的结果:保持模型框架的副本吗?如果的输入model“价值是一个模型框架(可能从早期的呼叫rpart函数),然后使用这个框架,而不是兴建新的数据。


参数:x
keep a copy of the x matrix in the result.
保持一份x矩阵结果。


参数:y
keep a copy of the dependent variable in the result.  If missing and model is supplied this defaults to FALSE.
结果因变量的副本。如果缺少model提供默认FALSE。


参数:parms
optional parameters for the splitting function.<br> Anova splitting has no parameters.<br> Poisson splitting has a single parameter, the coefficient of variation of the prior distribution on the rates.  The default value is 1.<br> Exponential splitting has the same parameter as Poisson.<br> For classification splitting, the list can contain any of: the vector of prior probabilities (component prior), the loss matrix (component loss) or the splitting index (component split).  The priors must be positive and sum to 1.  The loss matrix must have zeros on the diagonal and positive off-diagonal elements.  The splitting index can be gini or information.  The default priors are proportional to the data counts, the losses default to 1, and the split defaults to gini.
分裂的作用。参考方差分裂的可选参数,没有参数。参考的泊松分裂有一个参数,先验分布率的变异系数。默认值是1,参考指数分裂具有相同的参数为泊松参考,对于分类分裂列表可以包含任何。向量的先验概率(组件prior),损失矩阵(组件loss)或分裂指数(组件split)。先验必须是积极的和总和为1。亏损矩阵必须有对角线的和积极的非对角线元素为零。分裂指数可以gini或information。预设的先验是成正比的数据计数的损失,默认为1,分割默认gini。


参数:control
a list of options that control details of the rpart algorithm.  See rpart.control.
一个选项列表,rpart算法的控制细节。看到rpart.control。


参数:cost
a vector of non-negative costs, one for each variable in the model. Defaults to one for all variables.  These are scalings to be applied when considering splits, so the improvement on splitting on a variable is divided by its cost in deciding which split to choose.
一个非负成本的向量,对模型中的每个变量之一。默认为所有的变量之一。这些都是可以适用于结垢时,考虑分裂,因此对一个变量的分裂改善其成本分为决定分裂选择。


参数:...
arguments to rpart.control may also be specified in the call to rpart.  They are checked against the list of valid arguments.
rpart.control参数也可以指定调用rpart在。他们核对有效的参数列表。


Details

详情----------Details----------

This differs from the tree function in S mainly in its handling of surrogate variables.  In most details it follows Breiman et. al. quite closely.  R package tree provides a re-implementation of tree.
这不同于treeS中的功能主要是在处理其代理变量。在最细节如下布雷曼博士等。等。相当密切。 R包tree提供了tree重新执行。


值----------Value----------

An object of class rpart.  See rpart.object.
对象类rpart。看到rpart.object。


参考文献----------References----------

Classification and Regression Trees. Wadsworth.

参见----------See Also----------

rpart.control, rpart.object, summary.rpart, print.rpart
rpart.control,rpart.object,summary.rpart,print.rpart


举例----------Examples----------


fit <- rpart(Kyphosis ~ Age + Number + Start, data=kyphosis)
fit2 <- rpart(Kyphosis ~ Age + Number + Start, data=kyphosis,
              parms=list(prior=c(.65,.35), split='information'))
fit3 <- rpart(Kyphosis ~ Age + Number + Start, data=kyphosis,
              control=rpart.control(cp=.05))
par(mfrow=c(1,2), xpd=NA) # otherwise on some devices the text is clipped[否则在某些设备上的文字被截断]
plot(fit)
text(fit, use.n=TRUE)
plot(fit2)
text(fit2, use.n=TRUE)

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-5-6 07:17 , Processed in 0.024653 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表