NAME
Algorithm::KernelKMeans::Util
DESCRIPTION
This module provides some constants and functions suitable to use with Algorithm::KernelKMeans
.
CONSTANTS
Constants listed below represent kernels/initializers, which some methods require. It's recommended to use these constants instead of code reference, because clusterer implementations might have its own kernel/initializer code. So code references should be used iff there's no equivalent constants.
All constants are import()
able.
$KERNEL_POLYNOMINAL
Polynominal kernel. Takes 2 parameters ($l, $p) then will be formed like K(x1, x2) = ($l + x1 . x2)^$p, where "x1 . x2" represents inner product
.
$KERNEL_GAUSSIAN
Gaussian kernel. Takes 1 parameter ($sigma).
K(x1, x2) = exp(-||x1 - x2||^2 / (2 * $sigma)^2)
$KERNEL_SIGMOID
Sigmoid kernel. Takes 2 parameters ($s, $theta).
K(x1, x2) = tanh($s * (x1 . x2) + $theta)
$INITIALIZE_SIMPLE
$INITIALIZE_SHUFFLE
$INITIALIZE_KKZ
FUNCTIONS
This module exports nothing by default. You can import
functions below:
centroid($cluster)
Takes array ref of vectors and returns centroid vector of the cluster.
inner_product($v, $u)
Calculates inner product of $v
and $u
.
euclidean_distance($v, $u)
Computes euclidean distance between $v
and $u
.
AUTHOR
Koichi SATOH <r.sekia@gmail.com>