Learn R Programming

wSVM (version 0.1-7)

wsvm: Weighted SVM with boosting algorithm for improving accuracy

Description

Compute Weighter SVM with boosting algorithm

Usage

wsvm(X, Y, c.n, kernel = list(type = 'linear', par = NULL), C = 1, eps = 1e-10)

Arguments

X
input variable matrix. Data type must be a matrix format.
Y
output variable vector which will be declared as a matrix in SVM. Data type must be a matrix format.
c.n
weighted term.
kernel
set an attributes of kernel using list(). kernel$type means a type of kernel, including 'linear', 'poly', and 'rbf'. kernel$par means a parameter of kernel. For example, par = degree for 'poly' and par = scale for 'rbf'.
C
regularization parameter.
eps
epsilon value.

Value

  • A function wsvm generate a list consists of fit, alpha, bias and sv. model$fit = predicted values (n by 1) model$alpha = estimated coefficients (n by 1) model$bias = bias term model$sv = index of support vectors

Details

Weighted SVM with boosting algorithm for improving accuracy.

See Also

wsvm.predict, wsvm.boost

Examples

Run this code
# generate a simulation data set using mixture example(page 17, Friedman et al. 2000)

svm.data <- simul.wsvm(set.seeds = 123)
X <- svm.data$X
Y <- svm.data$Y
new.X <- svm.data$new.X
new.Y <- svm.data$new.Y

# run Weighted K-means clustering SVM with boosting algorithm
model <- wsvm(X, Y, c.n = rep(1/ length(Y),length(Y)))

# predict the model and compute an error rate. 
pred <- wsvm.predict(X,Y, new.X, new.Y, model)

Error.rate(pred$predicted.Y, Y)

# add boost algorithm

boo <- wsvm.boost(X, Y, new.X, new.Y, c.n = rep(1/ length(Y),length(Y)), 
    B = 50, kernel.type = list(type = "rbf", par= 0.5), C = 4, 
    eps = 1e-10, plotting = TRUE)
boo

Run the code above in your browser using DataLab