Package smile.base.svm
Class KernelMachine<T>
java.lang.Object
smile.base.svm.KernelMachine<T>
- Type Parameters:
T
- the data type of model input objects.
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
KernelMachine
,SVM
,SVM
Kernel machines. Kernel methods owe their name to
the use of kernel functions, which enable them to operate in a high-dimensional,
implicit feature space without ever computing the coordinates of the data
in that space, but rather by simply computing the inner products between
the images of all pairs of data in the feature space.
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 similarity function.
- See Also:
-
Constructor Summary
ConstructorDescriptionKernelMachine
(MercerKernel<T> kernel, T[] vectors, double[] weight) Constructor.KernelMachine
(MercerKernel<T> kernel, T[] vectors, double[] weight, double b) Constructor. -
Method Summary
-
Constructor Details
-
KernelMachine
Constructor.- Parameters:
kernel
- Kernel function.vectors
- The instances in the kernel machine, e.g. support vectors.weight
- The weights of instances.
-
KernelMachine
Constructor.- Parameters:
kernel
- Kernel function.vectors
- The instances in the kernel machine, e.g. support vectors.weight
- The weights of instances.b
- The intercept;
-
-
Method Details
-
kernel
Returns the kernel function.- Returns:
- the kernel function.
-
vectors
Returns the support vectors of kernel machines.- Returns:
- the support vectors of kernel machines.
-
weights
public double[] weights()Returns the weights of instances.- Returns:
- the weights of instances.
-
intercept
public double intercept()Returns the intercept.- Returns:
- the intercept.
-
score
Returns the decision function value.- Parameters:
x
- an instance.- Returns:
- the decision function value.
-
toString
-