public class KernelMachine<T>
extends java.lang.Object
implements java.io.Serializable
Kernel methods can be thought of as instance-based learners: rather than learning some fixed set of parameters corresponding to the features of their inputs, they instead store (a subset of) their training set (or a new representation) and learn for it a corresponding weight. Prediction for unlabeled inputs is treated by the application of a similiarity function.
Constructor and Description |
---|
KernelMachine(smile.math.kernel.MercerKernel<T> kernel,
T[] instances,
double[] weight)
Constructor.
|
KernelMachine(smile.math.kernel.MercerKernel<T> kernel,
T[] instances,
double[] weight,
double b)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
double |
f(T x)
Returns the decision function value.
|
T[] |
instances()
Returns the instances of kernel machines.
|
double |
intercept()
Returns the intercept.
|
smile.math.kernel.MercerKernel<T> |
kernel()
Returns the kernel function.
|
java.lang.String |
toString() |
SVM<T> |
toSVM()
Convert the kernel machine to SVM instance.
|
double[] |
weights()
Returns the weights of instances.
|
public KernelMachine(smile.math.kernel.MercerKernel<T> kernel, T[] instances, double[] weight)
kernel
- Kernel function.instances
- The instances in the kernel machine, e.g. support vectors.weight
- The weights of instances.public smile.math.kernel.MercerKernel<T> kernel()
public T[] instances()
public double[] weights()
public double intercept()
public double f(T x)
public java.lang.String toString()
toString
in class java.lang.Object