Пример #1
0
/**
 * Compute the spectrum kernel by Leslie et al. (2002). 
 * @param x first string 
 * @param y second string
 * @return spectrum kernel
 */
float kern_spectrum_compare(hstring_t x, hstring_t y)
{
    float k = kernel(x, y);
    return knorm(n, k, x, y, kernel);
}
Пример #2
0
/**
 * Internal kernel function.
 * @param x first string 
 * @param y second string
 * @return kernel value
 */
static float kernel(hstring_t x, hstring_t y)
{
    double k = func[kern].measure_compare(x, y);
    return knorm(norm, k, x, y, func[kern].measure_compare);
}
Пример #3
0
/**
 * Compute a distance substitution kernel
 * @param x first string 
 * @param y second string
 * @return distance substitution kernel
 */
float kern_distance_compare(hstring_t x, hstring_t y)
{
    float k = kernel(x, y);
    return knorm(norm, k, x, y, kernel);
}
Пример #4
0
/**
 * Compute the weighted-degree kernel with shift. If the strings have
 * unequal size, the remaining symbols of the longer string are ignored (in
 * accordance with the kernel definition)
 * @param x first string 
 * @param y second string
 * @return weighted-degree kernel
 */
float kern_wdegree_compare(hstring_t x, hstring_t y)
{
    float k = kernel(x, y);
    return knorm(n, k, x, y, kernel);
}