Learn R Programming

ramsvm (version 2.3)

predict: A function that provides class label predictions for objects returned by the "ramsvm" function.

Description

This function provides predictions on a test data set using the obtained classifier from a call of the ramsvm function.

Usage

# S4 method for ramsvm
predict(object,newdata=NULL,lambda=NULL,...)

Arguments

object

An object returned by the "ramsvm" function.

newdata

The new predictor matrix. The number and order of predictors in newdata should be the same as those of x, which is used in the ramsvm function. If not specified, the program uses the training x matrix as the prediction object.

lambda

The lambda values on which the user wants to predict. If not specified, the program will use the lambda values returned by the ramsvm function.

...

Not used.

Value

pred.y

A prediction is made for each lambda value.

References

C. Zhang, Y. Liu, J. Wang and H. Zhu. (2016). Reinforced Angle-based Multicategory Support Vector Machines. Journal of Computational and Graphical Statistics, 25, 806-825.

See Also

ramsvm

Examples

Run this code
# NOT RUN {
data(iris)
a <- ramsvm(x = as.matrix(iris[,-5]),
            y = iris[,5],
            lambda = 0.2,
            kernel="gaussian")
predict(a)
# }

Run the code above in your browser using DataLab