KPERCEPTR |
Kernel Perceptron.
Synopsis:
model = kperceptr(data)
model = kperceptr(data,options)
Description:
This function is an implementation of the kernel version
of the Perceptron algorithm. The kernel perceptron search
for the kernel binary classifier with zero emprical error.
Input:
data [struct] Binary labeled training data:
.X [dim x num_data] Vectors.
.y [1 x num_data] Labels (1 or 2).
options [struct] Control parameters:
.ker [string] Kernel identifier (default 'linear').
See 'help kernel' for more info.
.arg [1 x nargs] Kernel argument.
.tmax [1x1] Maximal number of iterations (default inf).
Output:
model [struct] Found kernel classifer:
.Alpha [nsv x 1] Multipliers of the training data.
.b [1x1] Bias of the decision rule.
.sv.X [dim x nsv] Training data with non-zero Alphas.
.exitflag [1x1] 1 ... Perceptron has converged.
0 ... Maximal number of iterations exceeded.
.iter [1x1] Number of iterations.
.kercnt [1x1] Number of kernel evaluations.
.trnerr [1x1] Training classification error; Note: if exitflag==1
then trnerr = 0.
.options [struct] Copy of options.
.cputime [real] Used cputime in seconds.
If the linear kernel is used then model.W [dim x 1] contains
normal vector of the separating hyperplane.
Example:
data = load('vltava');
model = kperceptr(data, struct('ker','poly','arg',2));
figure; ppatterns(data); pboundary(model);
See also SVMCLASS, SVM.
Modifications:
10-may-2004, VF
18-July-2003, VF
21-Nov-2001, V. Franc