Learn R Programming

smac (version 1.0)

cvsmac: A cross validation function for smac.

Description

This function is used to perform cross validation based on a training data set to select the best tuning parameter.

Usage

cvsmac(x,y,kfold=5,lambda=NULL,nlambda=100,lambda.min=NULL,seed=0,weight=NULL,...)

Arguments

Value

lambdaThe sequence of tuning parameters used in cross validation. Notice that the lambdas will be in a decreasing order.beta0The estimated intercepts with respect to each tuning parameter lambda.betaThe estimated parameters of the predictors with respect to each tuning parameter lambda.errorThe total number of misclassifications with respect to each tuning parameter lambda. If weight is specified, each miscalssification is multiplied by its corresponding weight.best.lambdaThe sequence of lambda values that have the smallest cross validation error.best.beta0The intercepts that correspond to best.lambda.best.betaThe parameters that correspond to best.lambda.modelThe fitted model with respect to each tuning parameter, using the entire training data set.min.errorThe minimum error in cross validation.

References

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

See Also

smac,predict.cvsmac

Examples

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

Run the code above in your browser using DataLab