In machine learning and data mining, a string kernel is a kernel function that operates on strings, i.e. finite sequences of symbols that need not be of the same length. String kernels can be intuitively understood as functions measuring the similarity of pairs of strings: the more similar two strings a and b are, the higher the value of a string kernel K(a, b) will be.
Using string kernels with kernelized learning algorithms such as support vector machines allow such algorithms to work with strings, without having to translate these to fixed-length, real-valued feature vectors. String kernels are used in domains where sequence data are to be clustered or classified, e.g. in text mining and gene analysis.
Suppose one wants to compare some text passages automatically and indicate their relative similarity.For many applications, it might be sufficient to find some keywords which match exactly.One example where exact matching is not always enough is found in spam detection.Another would be in computational gene analysis, where homologous genes have mutated, resulting in common subsequences along with deleted, inserted or replaced symbols.
Since several well-proven data clustering, classification and information retrievalmethods (for example support vector machines) are designed to work on vectors(i.e. data are elements of a vector space), using a string kernel allows the extension of these methods to handle sequence data.
The string kernel method is to be contrasted with earlier approaches for text classification where feature vectors only indicatedthe presence or absence of a word.Not only does it improve on these approaches, but it is an example for a whole class of kernels adapted to data structures, whichbegan to appear at the turn of the 21st century. A survey of such methods has been compiled by Gärtner.
In bioinformatics string kernels are used especially to transform biological sequences such as proteins or DNA into vectors for further use in machine learning models. An example of a string kernel used for that purpose is the profile kernel.[1]
A kernel on a domain
D
K:D x D → R
Mercer's theorem asserts that
K
K(x,y)=\varphi(x) ⋅ \varphi(y)
\varphi
\Sigma
\varphiu: \left\{ \begin{array}{l} \Sigman →
\Sigman | |
R |
\\ s\mapsto
\sum | |
i:u=si |
λl(i)\end{array} \right.
The
i
u
n
i
u
s
l(i)
i
s
u
λ
0
00
0
1
1
1l(i)=1
For several relevant algorithms, data enters into the algorithm only in expressions involving an inner product of feature vectors,hence the name kernel methods. A desirable consequence of this is that one does not need to explicitly calculate the transformation
\phi(x)