fit.model: Create a spls.constraint object by fitting a constraint spls...

Description Usage Arguments Details Value See Also Examples

View source: R/fit.model.R

Description

Create a spls.constraint object by fitting a constraint spls with the spls.hybrid function on a ‘bootsPLS’ object

Usage

1
fit.model(object,auto.tune,X,Y,ncomp,signature,alpha,limit,showProgress=TRUE)

Arguments

object

a ‘bootsPLS’ object', as obtained from bootsPLS.

auto.tune

Logical. If TRUE, tune the optimal number of component (ncomp) and which variables to select on each component (signature). It only works with object

X

Input matrix of dimension n * p; each row is an observation vector.

Y

Factor with at least q>2 levels.

ncomp

How many component are to be included in the sPLS-DA analysis?

signature

A list containing which variables to keep on each component.

alpha

Level of the test.

limit

Vector of maximal number of genes to include on each component.

showProgress

Logical. If TRUE, shows the progress of the algorithm.

Details

This function fit a spls.hybrid on the variables included in signature, which can be an input or internally calculated by setting auto.tune=TRUE. If object is given as an input, (X, Y) are ignored. If auto.tune=TRUE, ncomp, signature are ignored.

Value

A 'spls.constraint' object is returned for which plotIndiv is available.

The outputs are the ones from spls.hybrid, plus

data

A list of the input data X, Y, Y.mat (dummy matrix) and of signature, which is a list containing the variables kept on each component. If a tuning occurs, either for the number of components or for the variables or both, outputs $component.selection and $variable.selection are available; see component.selection and variable.selection.

See Also

prediction, CI.prediction, plotIndiv

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## Not run: 
data(MSC)
X=MSC$X
Y=MSC$Y


boot=bootsPLS(X=X,Y=Y,ncomp=3,many=5,kCV=5)

# with a bootsPLS object and auto.tune=TRUE
fit=fit.model(boot,auto.tune=TRUE)
plot(fit$component.selection)
plot(fit$variable.selection)

# with a bootsPLS object and ncomp=2
fit=fit.model(boot,ncomp=2)

# with a bootsPLS object and ncomp/signature as input
signature=fit$data$signature
fit=fit.model(boot,ncomp=2,signature=signature)

# with no bootsPLS object
fit=fit.model(X=X,Y=Y,ncomp=2,signature=signature)# bootsPLS object

plotIndiv(fit,ind.names=FALSE, legend=TRUE)


## End(Not run)

bootsPLS documentation built on May 17, 2018, 9:04 a.m.