predict.smac: A function that provides class label prediction and class...

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/predict.smac.r

Description

This function provides prediction on a test data set using the obtained classification model from a call of the smac function.

Usage

1
2
## S3 method for class 'smac'
predict(object,new.x=NULL,lambda=NULL,...)

Arguments

object

An object returned by the "smac" function.

new.x

The new predictor matrix. The number and order of predictors in new.x should be the same as those of x, which is used in the smac 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 smac function.

...

Not used.

Value

new.x

The predictor matrix used for prediction.

lambda

The lambda values used for prediction.

fitted.beta0

The predicted intercept for each lambda value.

fitted.beta

A list of predicted matrices of parameters for each lambda value. The matrices in the list correspond to the lambda values in the returned lambda object in orders. Each row of a matrix corresponds to a predictor, and the name of the predictor is recorded as the row name. Note that a predictor does not affect the class label if and only if all elements in that corresponding row are 0.

pred.y

A list of predicted labels for each observation in new.x. A prediction is made for each lambda value in the returned lambda object.

pred.prob

A list of data.frames containing predicted class conditional probabilities. Each data.frame object corresponds to a value in the 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.

Author(s)

Chong Zhang, Guo Xian Yau and Yufeng Liu

References

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

See Also

smac

Examples

1
2
3
data(ex1.data)
a=smac(ex1.data$ex1.x,ex1.data$ex1.y,loss="p",nlambda=30)
predict(a,ex1.data$ex1.new.x)

smac documentation built on May 29, 2017, 11:55 a.m.