predict.pamCat(scrime)
predict.pamCat()所属R语言包:scrime
Predict Method for pamCat Objects
预测方法pamCat对象
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Predicts the classes of new observations based on a Prediction Analysis of Categorical Data.
预测的基础上的预测分析分类数据类新的观测。
用法----------Usage----------
## S3 method for class 'pamCat'
predict(object, newdata, theta = NULL, add.nvar = FALSE,
type = c("class", "prob"), ...)
参数----------Arguments----------
参数:object
an object of class pamCat.
对象类pamCat。
参数:newdata
a numeric matrix consisting of the integers between 1 and n.cat, where n.cat is the number of levels each of the variables in newdata must take. Each row of newdata must represent the same variable as the corresponding row in the matrix data used to produce object. Each column corresponds to an observation for which the class should be predicted.
一个数字矩阵之间的整数n.cat,其中n.cat在newdata必须采取的每一个变量的数量水平。 newdata的每一行必须代表同一个变量的矩阵中相应的行data来产生object。每一列对应于一个观察类应预测。
参数:theta
a strictly positive numeric value specifying the value of the shrinkage parameter of the Prediction Analysis that should be used in the class prediction. If NULL, then the value of theta will be used that has led to the smallest misclassification rate in the initial Prediction Analysis generating object.
严格为正的数值,应使用在分类预测的预测分析的收缩参数指定的值。如果NULL,然后theta将被使用,导致了最小的错误率在最初的预测分析产生object。
参数:add.nvar
should the number of variables used in the class prediction be added to the output?
类的预测中使用的变量的数目应该被添加到输出?
参数:type
either "class" or "prob". If "class", then the predicted classes will be returned. Otherwise, the probabilities for the classes are returned.
是"class"或"prob"。如果"class",然后预测的类将被退回。否则,返回类的概率。
参数:...
Ignored.
忽略。
值----------Value----------
If add.nvar = FALSE, the predicted classes or the class probabilities (depending on type). Otherwise, a list consisting of <table summary="R valueblock"> <tr valign="top"><td>pred</td> <td> a vector or matrix containing the predicted classes or the class probabilities, respectively.</td></tr> <tr valign="top"><td>n.var</td> <td> the number of variables used in the prediction.</td></tr> </table>
如果add.nvar = FALSE,预测类或类的概率(根据type)。否则,一列由<table summary="R valueblock"> <tr valign="top"> <TD> pred</ TD> <td>一个向量或矩阵包含预测的类或类概率。</ TD> </ TR> <tr valign="top"> <TD>n.var </ TD> <TD>使用的变量的预测数。</ TD> </ TR > </ TABLE>
(作者)----------Author(s)----------
Holger Schwender, <a href="mailto:holger.schwender@udo.edu">holger.schwender@udo.edu</a>
参考文献----------References----------
Schwender, H.\ (2007). Statistical Analysis of Genotype and Gene Expression Data. Dissertation, Department of Statistics, University of Dortmund.
参见----------See Also----------
pamCat
pamCat
实例----------Examples----------
# Generate a data set consisting of 2000 rows (variables) and 50 columns.[生成数据集,由2000年列(变量)和50列。]
# Assume that the first 25 observations belong to class 1, and the other[假设在第25观测属于1类,而其他]
# 50 observations to class 2.[50观测到2级。]
mat <- matrix(sample(3, 100000, TRUE), 2000)
rownames(mat) <- paste("SNP", 1:2000, sep = "")
cl <- rep(1:2, e = 25)
# Apply PAM for categorical data to this matrix, and compute the[应用PAM这个矩阵的分类数据,并计算]
# misclassification rate on the training set, i.e. on mat.[在训练集上的错误率,即垫上。]
pam.out <- pamCat(mat, cl)
pam.out
# Now generate a new data set consisting of 20 observations, [立即生成一个新的数据集组成的20个观察值,]
# and predict the classes of these observations using the[这些观察和预测的类使用]
# value of theta that has led to the smallest misclassification[最小分类错误导致的θ值]
# rate in pam.out.[率在pam.out。]
mat2 <- matrix(sample(3, 40000, TRUE), 2000)
rownames(mat2) <- paste("SNP", 1:2000, sep = "")
predict(pam.out, mat2)
# Another theta, say theta = 4, can also be specified.[发言权另一个θ,θ= 4,也可以被指定。]
predict(pam.out, mat2, theta = 4)
# The class probabilities for each observation can be obtained by[可以通过以下方式获得的类概率对于每个观测]
predict(pam.out, mat2, theta = 4, type = "prob")
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|