File: ipop-class.Rd

package info (click to toggle)
r-cran-kernlab 0.9-33-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,216 kB
  • sloc: cpp: 6,011; ansic: 935; makefile: 2
file content (73 lines) | stat: -rw-r--r-- 1,671 bytes parent folder | download
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
\name{ipop-class}
\docType{class}
\alias{ipop-class}
\alias{primal,ipop-method}
\alias{dual,ipop-method}
\alias{how,ipop-method}
\alias{primal}
\alias{dual}
\alias{how}

\title{Class "ipop"}
\description{The quadratic problem solver class}
\section{Objects from the Class}{
Objects can be created by calls of the form \code{new("ipop", ...)}.
   or by calling the \code{ipop} function.
}
\section{Slots}{
  \describe{
    \item{\code{primal}:}{Object of class \code{"vector"} the primal
      solution of the problem}
    \item{\code{dual}:}{Object of class \code{"numeric"} the dual of the
    problem}
    \item{\code{how}:}{Object of class \code{"character"} convergence information}
  }
}
\section{Methods}{
  \describe{
    \item{primal}{\code{signature(object = "ipop")}: Return the primal of
      the problem}
    \item{dual}{\code{signature(object = "ipop")}: Return the dual of
      the problem}
    \item{how}{\code{signature(object = "ipop")}: Return information on
      convergence}
  }
}
  \author{Alexandros Karatzoglou\cr
    \email{alexandros.karatzoglou@ci.tuwien.ac.at}}

\seealso{
  \code{\link{ipop}}

}
\examples{
## 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)

}
\keyword{classes}