rpartScore(rpartScore)
rpartScore()所属R语言包:rpartScore
Classification trees for ordinal responses
分类树为序反应
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This function allows the user to build classification trees for ordinal responses within the CART framework. The trees are grown using the Generalized Gini impurity function, where the misclassification costs are given by the absolute or squared differences in scores assigned to the categories of the response. Pruning is based on the total misclassification rate or on the total misclassification cost.
此功能允许用户建立分类树序反应的CART框架内的。使用广义的的基尼杂质功能,误判成本的绝对或平方差的分数分配给响应的类别生长的树木。修剪是根据的总错误率或总误判成本。
用法----------Usage----------
rpartScore(formula, data, weights, subset, na.action = na.rpart,
split = "abs", prune = "mc",
model = FALSE, x = FALSE, y = TRUE,
control, ...)
参数----------Arguments----------
参数:formula
a formula, as in the lm function.
的公式,如在lm函数。
参数: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缺少,但一直缺少一个或多个预测。
参数:split
One of "abs" or "quad".
一个"abs"或"quad"。
参数:prune
One of "mc" or "mr".
一个"mc"或"mr"。
参数: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 or rpartScore function), then this frame is used rather than constructing new data.
如果逻辑的结果:保持复制的模型框架?如果模型的输入值是一个模型框架(很可能是从以前调用rpart或rpartScore函数),然后使用这个框架,而不是兴建新的数据。
参数: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。
参数:control
options that control details of the rpart algorithm.
选项,控制rpart算法的细节。
参数:...
arguments to rpart.control may also be specified in the call to rpartScore. They are checked against the list of valid arguments.
也可以指定在调用rpart.controlrpartScore的参数。它们是有效的参数列表中核对。
Details
详细信息----------Details----------
The use of this function is almost the same as the rpart function. <br> It is assumed that a set of (not necessarily linear) numerical scores has been assigned to the ordered categories of the response.<br> The main difference with respect to the rpart function is the presence of two arguments (split and prune) instead of the method argument.<br> The argument split controls the splitting function used to grow the classification tree, by setting the misclassification costs in the generalized Gini impurity function equal to the absolute ("abs" - is the default option) or to the squared ("quad") differences in scores. <br> The argument prune allows the user to select the prediction performance measure used to prune the classification tree, and can take two values: "mr" (total misclassification rate) or "mc" (total misclassification cost - is the default option).
此函数的使用作为rpart功能几乎是相同的。参考假定一组(不一定是线性的)数值分数已被分配给的有序类别的响应。rpart函数相对于参考的主要区别是两个参数的存在下(split和prune)而不是method的说法。<BR>参数split增长的分类树控制的分离功能,通过设置误判成本广义的基尼杂质功能等于绝对("abs"“ - 是默认选项)的平方("quad"),成绩的差异。参考参数prune允许用户选择的预测性能指标用于修剪的分类树,并可以取两个值:"mr"(总错误率)或"mc"(总误判成本 - 是默认选项)。
值----------Value----------
An object of class rpart, a superset of class tree.
对象的类rpart,一个超类tree。
(作者)----------Author(s)----------
Giuliano Galimberti, Gabriele Soffritti, Matteo Di Maso
参考文献----------References----------
Journal of Statistical Software, 47(10), 1-25. URL http://www.jstatsoft.org/v47/i10/.
Technical Report 61, Section of Biostatistics, Mayo Clinic, Rochester. URL http://www.mayo.edu/hsr/techrpt/61.pdf.
参见----------See Also----------
rpart,rpart.control, rpart.object,summary.rpart, print.rpart
rpart,rpart.control,rpart.object,summary.rpart,print.rpart
实例----------Examples----------
require("rpartOrdinal")
data("lowbwt")
lowbwt$Category.s <- ifelse(lowbwt$bwt <= 2500, 3,
ifelse(lowbwt$bwt <= 3000, 2,
ifelse(lowbwt$bwt <= 3500, 1, 0)))
T.abs.mc <- rpartScore(Category.s ~ age + lwt + race + smoke +
ptl + ht + ui + ftv, data = lowbwt)
plotcp(T.abs.mc)
T.abs.mr <- rpartScore(Category.s ~ age + lwt + race + smoke +
ptl + ht + ui + ftv, data = lowbwt, prune = "mr")
T.quad.mc <- rpartScore(Category.s ~ age + lwt + race + smoke +
ptl + ht + ui + ftv, split = "quad", data = lowbwt)
T.quad.mr <- rpartScore(Category.s ~ age + lwt + race + smoke + ptl + ht +
ui + ftv, split = "quad", prune = "mr", data = lowbwt)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|