Holds information for a non-linear Support Vector Machine.
Members:
xs A list of the input vectors.
ys A list of the output values. Must be either 1 or -1.
alphas A list of the Lagrange multipliers for each point.
b The threshold value for the machine.
kernel_fn Should take 2 vectors and return a distance.
xs, ys, and alphas should be a parallel list of vectors.
** There's a special read-only member variable w . For linear
SVM's, this is the w vector so that the decision hyperplane is at
wx-b=0
Methods
|
|
__getattr__
__init__
|
|
__getattr__
|
__getattr__ ( self, x )
|
|
__init__
|
__init__ (
self,
xs,
ys,
alphas=None,
b=None,
kernel_fn=LinearKernel(),
)
Exceptions
|
|
ValueError, "Output must be either 1 or -1"
ValueError, "xs and alphas must be parallel arrays"
ValueError, "xs and ys must be parallel arrays"
|
|
|