Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

predict.spls

Make predictions or extract coefficients from a fitted SPLS model


Description

Make predictions or extract coefficients from a fitted SPLS object.

Usage

## S3 method for class 'spls'
predict( object, newx, type = c("fit","coefficient"), ... )
## S3 method for class 'spls'
coef( object, ... )

Arguments

object

A fitted SPLS object.

newx

If type="fit", then newx should be the predictor matrix of test dataset. If newx is omitted, then prediction of training dataset is returned. If type="coefficient", then newx can be omitted.

type

If type="fit", fitted values are returned. If type="coefficient", coefficient estimates of SPLS fits are returned.

...

Any arguments for predict.spls should work for coef.spls.

Details

Users can input either only selected variables or all variables for newx.

Value

Matrix of coefficient estimates if type="coefficient". Matrix of predicted responses if type="fit".

Author(s)

Dongjun Chung, Hyonho Chun, and Sunduz Keles.

References

Chun H and Keles S (2010), "Sparse partial least squares for simultaneous dimension reduction and variable selection", Journal of the Royal Statistical Society - Series B, Vol. 72, pp. 3–25.

See Also

Examples

data(yeast)
# SPLS with eta=0.7 & 8 latent components
f <- spls( yeast$x, yeast$y, K=8, eta=0.7 )
# Coefficient estimates of the SPLS fit
coef.f <- coef(f)
coef.f[1:5,]
# Prediction on the training dataset
pred.f <- predict( f, type="fit" )
pred.f[1:5,]

spls

Sparse Partial Least Squares (SPLS) Regression and Classification

v2.2-3
GPL (>= 2)
Authors
Dongjun Chung <chungdon@stat.wisc.edu>, Hyonho Chun <chun@stat.wisc.edu>, Sunduz Keles <keles@stat.wisc.edu>
Initial release
2019-05-04

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.