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

R语言 tree包 predict.tree()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-10-1 11:54:53 | 显示全部楼层 |阅读模式
predict.tree(tree)
predict.tree()所属R语言包:tree

                                         Predictions from a Fitted Tree Object
                                         从合身树对象的预测

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

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

Returns a vector of predicted responses from a fitted tree object.
返回一个矢量预测的响应从一个装有树对象。


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


## S3 method for class 'tree'
predict(object, newdata = list(),
        type = c("vector", "tree", "class", "where"),
        split = FALSE, nwts, eps = 1e-3, ...)



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

参数:object
fitted model object of class tree.  This is assumed to be the result of some function that produces an object with the same named components as that returned by the tree function.  
拟合模型对象的类tree。这被认为是一些函数,该函数产生的对象具有相同的命名组件tree函数返回的结果。


参数:newdata
data frame containing the values at which predictions are required. The predictors referred to in the right side of formula(object) must be present by name in newdata. If missing, fitted values are returned.  
含有预测所需的值,在该值的数据框。在右侧formula(object)的预测因子中的名称必须存在newdata。如果缺少,拟合值被返回。


参数:type
character string denoting whether the predictions are returned as a vector (default) or as a tree object.  
字符串表示的预测是否会返回一个向量(默认)或树对象。


参数:split
governs the handling of missing values. If false, cases with missing values are dropped down the tree until a leaf is reached or a node for which the attribute is missing, and that node is used for prediction. If split = TRUE cases with missing attributes are split into fractional cases and dropped down each side of the split. The predicted values are averaged over the fractions to give the prediction.  
管理处理缺失值。具有缺失值的情况下,如果为false,都将被丢弃,直到叶的树达到或缺少该属性节点,该节点用于预测。如果split = TRUE情况下,缺少属性的分数情况下,被分成掉了下来,每个侧裂。的预测值的平均值以上的馏分,得到的预测。


参数:nwts
weights for the newdata cases, used when predicting a tree.  
权重的newdata情况下,使用时预测的树。


参数:eps
a lower bound for the probabilities, used if events of predicted probability zero occur in newdata when predicting a tree.  
一个下界的概率,预测树时,如果预测的概率为零的事件发生在newdata。


参数:...
further arguments passed to or from other methods.
进一步的参数传递给其他方法。


Details

详细信息----------Details----------

This function is a method for the generic function predict() for class tree. It can be invoked by calling predict(x) for an object x of the appropriate class, or directly by calling predict.tree(x) regardless of the class of the object.
这个函数是一个方法的通用函数predict()类tree。它可以调用是通过调用predict(x)的对象x适当的类,或直接致电predict.tree(x)的类的对象。


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

If type = "vector": vector of predicted responses or, if the response is a factor, matrix of predicted class probabilities.  This new object is obtained by dropping newdata down object.  For factor predictors, if an observation contains a level not used to grow the tree, it is left at the deepest possible node and frame$yval or frame$yprob at that node is the prediction.
如果type = "vector":矢量预测的响应,如果响应是一个因素,预测类的概率矩阵。这个新的对象是通过下降newdata下降object。因素的预测,如果一个的观察包含一个水平不增长的树,它留在最深的节点和frame$yval或frame$yprob在该节点的预测。

If type = "tree": an object of class "tree" is returned with new values for frame$n and frame$dev. If newdata does not contain a column for the response in the formula the value of frame$dev will be NA, and if some values in the response are missing, the some of the deviances will be NA.
如果type = "tree":类"tree"的对象则返回新的值frame$n和frame$dev。如果newdata不包含一列的响应公式中的价值frame$dev将NA“中的某些值的响应,如果丢失的deviances会NA。

If type = "class": for a classification tree, a factor of the  predicted classes (that with highest posterior probability, with ties split randomly).
如果type = "class":一个分类树,一个因素的预测类(即最高后验概率,随机分割的关系)。

If type = "where": the nodes the cases reach.
如果type = "where":节点的情况下达到的。


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

Pattern Recognition and Neural Networks. Cambridge University Press, Cambridge. Chapter 7.

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

predict, tree.
predict,tree。


实例----------Examples----------


data(shuttle, package="MASS")
shuttle.tr <- tree(use ~ ., shuttle, subset=1:253,
                   mindev=1e-6, minsize=2)
shuttle.tr
shuttle1 &lt;- shuttle[254:256, ]  # 3 missing cases[3名失踪情况]
predict(shuttle.tr, shuttle1)

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-29 20:48 , Processed in 0.021406 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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