Description Usage Arguments Value Author(s) Examples
Prediction of test data using distance weighted discrimination
1 2 | ## S4 method for signature 'kdwd'
predict(object, newdata)
|
object |
an S4 object of class |
newdata |
a data frame or matrix containing new data |
predicted classes.
Hanwen Huang: hanwenh@email.unc.edu; Perry Haaland: Perry_Haaland@bd.com; Xiaosun Lu: Xiaosun_Lu@bd.com; Frances Tong: Frances_Tong@bd.com; Elaine McVey: Elaine_McVey@bd.com; Yufeng Liu: yfliu@email.unc.edu; J. S. Marron: marron@email.unc.edu
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## example using the promotergene data set
data(promotergene)
## create test and training set
ind <- sample(1:dim(promotergene)[1],20)
genetrain <- promotergene[-ind, ]
genetest <- promotergene[ind, ]
## train a distance weighted discrimination
gene <- kdwd(Class~.,data=genetrain,C=100,cross=5,scaled=TRUE)
gene@fitted
## predict gene type on the test set
genetype <- predict(gene,genetest)
genetype
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.