glpls1a.train.test.error: out-of-sample test set error using IRWPLS and IRWPLSF model

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/glpls1a.error.R

Description

Out-of-sample test set error for fitting IRWPLS or IRWPLSF model on the training set for two-group classification

Usage

1
glpls1a.train.test.error(train.X,train.y,test.X,test.y,K.prov=NULL,eps=1e-3,lmax=100,family="binomial",link="logit",br=T)

Arguments

train.X

n by p design matrix (with no intercept term) for training set

train.y

response vector (0 or 1) for training set

test.X

transpose of the design matrix (with no intercept term) for test set

test.y

response vector (0 or 1) for test set

K.prov

number of PLS components, default is the rank of train.X

eps

tolerance for convergence

lmax

maximum number of iteration allowed

family

glm family, binomial is the only relevant one here

link

link function, logit is the only one practically implemented now

br

TRUE if Firth's bias reduction procedure is used

Value

error

out-of-sample test error

error.obs

the misclassified error observation indices

predict.test

the predicted probabilities for test set

Author(s)

Beiying Ding, Robert Gentleman

References

See Also

glpls1a.cv.error, glpls1a.mlogit.cv.error, glpls1a, glpls1a.mlogit, glpls1a.logit.all

Examples

1
2
3
4
5
6
7
8
9
 x <- matrix(rnorm(20),ncol=2)
 y <- sample(0:1,10,TRUE)
 x1 <- matrix(rnorm(10),ncol=2)
 y1 <- sample(0:1,5,TRUE)

 ## no bias reduction
 glpls1a.train.test.error(x,y,x1,y1,br=FALSE)
 ## bias reduction
 glpls1a.train.test.error(x,y,x1,y1,br=TRUE)

gpls documentation built on Nov. 17, 2017, 11:56 a.m.