predict.kdwd: predict method for DWD object

Description Usage Arguments Value Author(s) Examples

Description

Prediction of test data using distance weighted discrimination

Usage

1
2
## S4 method for signature 'kdwd'
predict(object, newdata)

Arguments

object

an S4 object of class kdwd created by the kdwd function

newdata

a data frame or matrix containing new data

Value

predicted classes.

Author(s)

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

Examples

 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

DWD documentation built on May 2, 2019, 5 p.m.

Related to predict.kdwd in DWD...