prediction(ROCR)
prediction()所属R语言包:ROCR
Function to create prediction objects
函数来创建预测对象
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Every classifier evaluation using ROCR starts with creating a prediction object. This function is used to transform the input data (which can be in vector, matrix, data frame, or
每个分类评价使用ROCR开始创建一个prediction对象的。此功能用于变换的输入数据(其可以是向量,矩阵中,数据框,或
用法----------Usage----------
prediction(predictions, labels, label.ordering = NULL)
参数----------Arguments----------
参数:predictions
A vector, matrix, list, or data frame containing the predictions.
一个向量,矩阵,列表或数据框中包含的预测。
参数:labels
A vector, matrix, list, or data frame containing the true class labels. Must have the same dimensions as 'predictions'.
一个向量,矩阵,列表或数据框中包含的真正的类标签。必须具有相同的尺寸的“预测”。
参数:label.ordering
The default ordering (cf.details) of the classes can be changed by supplying a vector containing the negative and the positive class label.
默认排序(cf.details)的类是可以改变的,通过提供一个向量,包含的负和正类标签。
Details
详细信息----------Details----------
'predictions' and 'labels' can simply be vectors of the same length. However, in the case of cross-validation data, different cross-validation runs can be provided as the *columns* of a matrix or data frame, or as the entries of a list. In the case of a matrix or data frame, all cross-validation runs must have the same length, whereas in the case of a list, the lengths can vary across the cross-validation runs. Internally, as described in section 'Value', all of these input formats are converted to list representation.
“预测”和“标签”可以简单地是相同的长度的向量。然而,在交叉验证数据的情况下,不同的交叉验证运行可以设置为*列*一个矩阵或数据框,或者作为一个列表的条目。在一个矩阵或数据框的情况下,所有的交叉验证运行必须具有相同的长度,而在一个列表中的情况下,其长度可以各不相同的交叉验证运行。内部,在节价值,所有的这些输入格式转换为列表表示。
Since scoring classifiers give relative tendencies towards a negative (low scores) or positive (high scores) class, it has to be declared which class label denotes the negative, and which the positive class. Ideally, labels should be supplied as ordered factor(s), the lower level corresponding to the negative class, the upper level to the positive class. If the labels are factors (unordered), numeric, logical or characters, ordering of the labels is inferred from R's built-in < relation (e.g. 0 < 1, -1 < 1, 'a' < 'b', FALSE < TRUE). Use label.ordering to override this default ordering. Please note that the ordering can be locale-dependent e.g. for character labels '-1' and '1'.
得分的分类给相对倾向为负(低分数)或阳性(高分)类,它都将被声明的类标签表示否定,并积极类。理想的情况下,标签应供给的命令因子(s),较低的水平对应于负的类,正类的上层。如果标签的因素(无序的),数字,逻辑或字符,订购的标签可以推断,从R的内置<关系(例如,0 <1,-1 <1,A< B<TRUE,FALSE)。使用label.ordering覆盖这个默认顺序。请注意的顺序可以是语言环境相关的,如字符标签-1和1。
Currently, ROCR supports only binary classification (extensions toward multiclass classification are scheduled for the next release, however). If there are more than two distinct label symbols, execution stops with an error message. If all predictions use the same two symbols that are used for the labels, categorical predictions are assumed. If there are more than two predicted values, but all numeric, continuous predictions are assumed (i.e. a scoring classifier). Otherwise, if more than two symbols occur in the predictions, and not all of them are numeric, execution stops with an
目前,ROCR只支持二进制分类(向多类分类的扩展,预计在未来的版本中),但是。如果有两个以上的不同的标签符号,停止执行错误消息。如果所有的预测使用两个相同的码元,用于标签,类别预测假定。如果有两个以上的预测值,但所有的数值,连续预测假定(即评分分类)。否则,如果出现两个以上符号的预言,不是所有的人都是数字,执行与停止
值----------Value----------
An S4 object of class prediction.
S4对象的类prediction。
(作者)----------Author(s)----------
Tobias Sing <a href="mailto:tobias.sing@mpi-sb.mpg.de">tobias.sing@mpi-sb.mpg.de</a>,
Oliver Sander <a href="mailtosander@mpi-sb.mpg.de">osander@mpi-sb.mpg.de</a>
参考文献----------References----------
参见----------See Also----------
prediction-class, performance,
prediction-class,performance,
实例----------Examples----------
# create a simple prediction object[创建一个简单的预测对象]
library(ROCR)
data(ROCR.simple)
pred <- prediction(ROCR.simple$predictions,ROCR.simple$labels)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|