May 2020
Intermediate to advanced
530 pages
17h 8m
English
The Dlib library uses kernel functions as the distance functions for the k-means algorithm. An example of such a function is the radial basis function. As an initial step, we define the required types, as follows:
typedef matrix<double, 2, 1> sample_type; typedef radial_basis_kernel<sample_type> kernel_type;
Then, we initialize an object of the kkmeans type. Its constructor takes an object that will define cluster centroids as input parameters. We can use an object of the kcentroid type for this purpose. Its constructor takes three parameters: the first one is the object that defines the kernel (distance function), the second is the numerical accuracy for the centroid estimation, and the third one is the upper ...
Read now
Unlock full access