predict.rvbm {rpud} | R Documentation |
The predict.rvbm
method predicts class
membership of given test data based on
the Gaussian process model created by rvbm
.
## S3 method for class 'rvbm' predict(object, X.TEST=NULL, ...)
object |
An S3 object that inherits from the class |
X.TEST |
A matrix of new test data. If NULL, the feature matrix in obj is used instead. |
... |
Not used. |
An vector containing the predicted class membership based on the maximum posterior probability.
An attribute named Ptest
contains the predicted posterior probability.
This replaces the predictCPP
and predClass
methods in vbmp
.
Chi Yau
chi.yau@r-tutor.com
rvbm
, vbmp
## Not run: library(rpud) x <- rvbm.sample.train$X y <- rvbm.sample.train$t.class model.rvbm <- rvbm( x, y, x, y, theta = rep(1, ncol(x)), control = list( sKernelType="gaussian", bThetaEstimate=TRUE, bMonitor=TRUE, InfoLevel=1) ) res <- predict(model.rvbm, rvbm.test$X) err <- sum(res != rvbm.test$t.class); err rate <- err/length(rvbm.test$t.class)*100; rate ## End(Not run)