stringdot {kernlab} | R Documentation |
String Kernel Functions
Description
String kernels.
Usage
stringdot(length = 4, lambda = 1.1, type = "spectrum", normalized = TRUE)
Arguments
length |
The length of the substrings considered |
lambda |
The decay factor |
type |
Type of string kernel, currently the following kernels are
supported :
|
normalized |
normalize string kernel values, (default: |
Details
The kernel generating functions are used to initialize a kernel function
which calculates the dot (inner) product between two feature vectors in a
Hilbert Space. These functions or their function generating names
can be passed as a kernel
argument on almost all
functions in kernlab(e.g., ksvm
, kpca
etc.).
The string kernels calculate similarities between two strings
(e.g. texts or sequences) by matching the common substring
in the strings. Different types of string kernel exists and are
mainly distinguished by how the matching is performed i.e. some string
kernels count the exact matchings of n
characters (spectrum
kernel) between the strings, others allow gaps (mismatch kernel) etc.
Value
Returns an S4 object of class stringkernel
which extents the
function
class. The resulting function implements the given
kernel calculating the inner (dot) product between two character vectors.
kpar |
a list containing the kernel parameters (hyperparameters) used. |
The kernel parameters can be accessed by the kpar
function.
Note
The spectrum
and boundrange
kernel are faster and
more efficient implementations of the string
and
fullstring
kernels
which will be still included in kernlab
for the next two versions.
Author(s)
Alexandros Karatzoglou
alexandros.karatzoglou@ci.tuwien.ac.at
See Also
dots
, kernelMatrix
, kernelMult
, kernelPol
Examples
sk <- stringdot(type="string", length=5)
sk