Learn R Programming

smac (version 1.0)

predict.cvsmac: A function that provides class label prediction and class conditional probability estimation for objects returned by the "cvsmac" function.

Description

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

Usage

## S3 method for class 'cvsmac':
predict(object,new.x = NULL,...)

Arguments

Value

new.xThe new testing matrix used for prediction.best.lambdaThe sequence of lambda values that have the smallest cross validation error in the training data set.best.beta0The beta0 values that correspond to the best.lambda sequence.best.betaThe beta values that correspond to the best.lambda sequence.best.pred.yThe predicted labels for new.x.best.pred.probA list of data.frame containing predicted class conditional probabilities. Each data.frame corresponds to a value in the best.lambda object. Each row of the data.frames corresponds to an observation in new.x, and each column represents a class, with the column name as the class label.callThe function call that returns this result.

References

C. Zhang and Y. Liu (2014). Multicategory Angle-based Large-margin Classification. Biometrika, 101(3), 625-640.

See Also

cvsmac, predict.smac

Examples

Run this code
data(ex1.data)
a=cvsmac(ex1.data$ex1.x,ex1.data$ex1.y,loss="p",nlambda=30)
predict(a,ex1.data$ex1.new.x)

Run the code above in your browser using DataLab