Description Usage Arguments Details Value Author(s) See Also Examples
Pre-processing of new data by osc
.
1 2 |
object |
Object of class |
newdata |
A matrix or data frame of cases to be corrected by OSC. |
... |
Arguments based from or to other methods. |
This function is a method for the generic function predict()
for
class osc
. If newdata
is omitted, the corrected data set used in model of
osc
will be returned.
A list containing the following components:
x |
A matrix of OSC corrected data set. |
Q2 |
The fraction of variation in X after OSC correction for the new data. |
Wanchang Lin
osc
, osc_wold
, osc_sjoblom
,
osc_wise
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | data(abr1)
cl <- factor(abr1$fact$class)
dat <- abr1$pos
## divide data as training and test data
idx <- sample(1:nrow(dat), round((2/3)*nrow(dat)), replace=FALSE)
## construct train and test data
train.dat <- dat[idx,]
train.t <- cl[idx]
test.dat <- dat[-idx,]
test.t <- cl[-idx]
## build OSC model based on the training data
res <- osc(train.dat, train.t, method="wold",osc.ncomp=2, pls.ncomp=4)
names(res)
res
summary(res)
## pre-process test data by OSC
test <- predict(res,test.dat)
test.dat.1 <- test$x
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.