pls.kodama: Partial Least Squares regression.

pls.kodamaR Documentation

Partial Least Squares regression.

Description

Partial Least Squares (PLS) regression for test set from training set.

Usage

pls.kodama(Xtrain, 
           Ytrain, 
           Xtest, 
           Ytest = NULL, 
           ncomp, 
           scaling = c("centering","autoscaling"),
           perm.test=FALSE,
           times=1000) 

Arguments

Xtrain

a matrix of training set cases.

Ytrain

a classification vector.

Xtest

a matrix of test set cases.

Ytest

a classification vector.

ncomp

the number of components to consider.

scaling

the scaling method to be used. Choices are "centering" or "autoscaling" (by default = "centering"). A partial string sufficient to uniquely identify the choice is permitted.

perm.test

a classification vector.

times

a classification vector.

Value

A list with the following components:

B

the (p x m x length(ncomp)) matrix containing the regression coefficients. Each row corresponds to a predictor variable and each column to a response variable. The third dimension of the matrix B corresponds to the number of PLS components used to compute the regression coefficients. If ncomp has length 1, B is just a (p x m) matrix.

Ypred

the (ntest x m x length(ncomp)) containing the predicted values of the response variables for the observations from Xtest. The third dimension of the matrix Ypred corresponds to the number of PLS components used to compute the regression coefficients.

P

the (p x max(ncomp)) matrix containing the X-loadings.

Q

the (m x max(ncomp)) matrix containing the Y-loadings.

T

the (ntrain x max(ncomp)) matrix containing the X-scores (latent components)

R

the (p x max(ncomp)) matrix containing the weights used to construct the latent components.

Author(s)

Stefano Cacciatore

References

Cacciatore S, Luchinat C, Tenori L
Knowledge discovery by accuracy maximization.
Proc Natl Acad Sci U S A 2014;111(14):5117-22. doi: 10.1073/pnas.1220873111. Link

Cacciatore S, Tenori L, Luchinat C, Bennett PR, MacIntyre DA
KODAMA: an updated R package for knowledge discovery and data mining.
Bioinformatics 2017;33(4):621-623. doi: 10.1093/bioinformatics/btw705. Link

See Also

KODAMA.matrix,KODAMA.visualization

Examples

data(iris)
data=iris[,-5]
labels=iris[,5]
ss=sample(150,15)
ncomponent=3

z=pls.kodama(data[-ss,], labels[-ss], data[ss,], ncomp=ncomponent) 
table(z$Ypred[,ncomponent],labels[ss])

KODAMA documentation built on Jan. 12, 2023, 5:08 p.m.