Description Objects from the Class Slots Methods Author(s) See Also Examples
The quadratic problem solver class
Objects can be created by calls of the form new("ipop", ...)
.
or by calling the ipop
function.
primal
:Object of class "vector"
the primal
solution of the problem
dual
:Object of class "numeric"
the dual of the
problem
how
:Object of class "character"
convergence information
Object of class ipop
Return the primal of the problem
Object of class ipop
Return the dual of the problem
Object of class ipop
Return information on convergence
Alexandros Karatzoglou
alexandros.karatzoglou@ci.tuwien.ac.at
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | ## solve the Support Vector Machine optimization problem
data(spam)
## sample a scaled part (300 points) of the spam data set
m <- 300
set <- sample(1:dim(spam)[1],m)
x <- scale(as.matrix(spam[,-58]))[set,]
y <- as.integer(spam[set,58])
y[y==2] <- -1
##set C parameter and kernel
C <- 5
rbf <- rbfdot(sigma = 0.1)
## create H matrix etc.
H <- kernelPol(rbf,x,,y)
c <- matrix(rep(-1,m))
A <- t(y)
b <- 0
l <- matrix(rep(0,m))
u <- matrix(rep(C,m))
r <- 0
sv <- ipop(c,H,A,b,l,u,r)
primal(sv)
dual(sv)
how(sv)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.