predict.rvbm {rpud}R Documentation

Predict Method for Variational Bayesian Multiclass Probit Regression

Description

The predict.rvbm method predicts class membership of given test data based on the Gaussian process model created by rvbm.

Usage

## S3 method for class 'rvbm'
predict(object, X.TEST=NULL, ...)

Arguments

object

An S3 object that inherits from the class rvbm.

X.TEST

A matrix of new test data. If NULL, the feature matrix in obj is used instead.

...

Not used.

Value

An vector containing the predicted class membership based on the maximum posterior probability. An attribute named Ptest contains the predicted posterior probability.

Note

This replaces the predictCPP and predClass methods in vbmp.

Author(s)

Chi Yau
chi.yau@r-tutor.com

See Also

rvbm, vbmp

Examples

## 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)

[Package rpud version 0.7.0 Index]