Documentation - C API
hikmeans.h File Reference

Hierarchical integer K-Means clustering. More...

#include "generic.h"
#include "ikmeans.h"

Data Structures

struct  VlHIKMNode
 HIKM tree node. More...
struct  VlHIKMTree
 HIKM tree. More...

Functions

Create and destroy
VlHIKMTreevl_hikm_new (int method)
 New HIKM tree.
void vl_hikm_delete (VlHIKMTree *f)
 Delete HIKM tree.
Retrieve data and parameters
int vl_hikm_get_ndims (VlHIKMTree const *f)
 Get data dimensionality.
int vl_hikm_get_K (VlHIKMTree const *f)
 Get K.
int vl_hikm_get_depth (VlHIKMTree const *f)
 Get depth.
int vl_hikm_get_verbosity (VlHIKMTree const *f)
 Get verbosity level.
int vl_hikm_get_max_niters (VlHIKMTree const *f)
 Get maximum number of iterations.
VlHIKMNode const * vl_hikm_get_root (VlHIKMTree const *f)
 Get maximum number of iterations.
Set parameters
void vl_hikm_set_verbosity (VlHIKMTree *f, int verb)
 Set verbosity level.
void vl_hikm_set_max_niters (VlHIKMTree *f, int max_niters)
 Set maximum number of iterations.
Process data
void vl_hikm_init (VlHIKMTree *f, int M, int K, int depth)
 Initialize HIKM tree.
void vl_hikm_train (VlHIKMTree *f, vl_uint8 const *data, int N)
 Train HIKM tree.
void vl_hikm_push (VlHIKMTree *f, vl_uint *asgn, vl_uint8 const *data, int N)
 Project data down HIKM tree.

Detailed Description

Hierarchical Integer K-Means Clustering.

Hierarchical integer K-Means clustering (HIKM) is a simple hierarchical version of integer K-Means (IKM). The algorithm recursively applies integer K-means to create more refined partitions of the data.

Create a tree with vl_hikm_new() and delete it with vl_hikm_delete(). Use vl_hikm_train() to build the tree from training data and vl_hikm_push() to project new data down a HIKM tree.

HIKM tree

The HIKM tree is represented by a VlHIKMTree structure, which contains a tree composed of VlHIKMNode. Each node is an integer K-means filter which partitions the data into K clusters.

Author:
Brian Fulkerson

Function Documentation

void vl_hikm_delete ( VlHIKMTree f)
Parameters:
fHIKM tree.
int vl_hikm_get_depth ( VlHIKMTree const *  f)
inline
Parameters:
fHIKM tree.
Returns:
depth.
int vl_hikm_get_K ( VlHIKMTree const *  f)
inline
Parameters:
fHIKM tree.
Returns:
K.
int vl_hikm_get_max_niters ( VlHIKMTree const *  f)
inline
Parameters:
fHIKM tree.
Returns:
maximum number of iterations.
int vl_hikm_get_ndims ( VlHIKMTree const *  f)
inline
Parameters:
fHIKM tree.
Returns:
data dimensionality.
VlHIKMNode const * vl_hikm_get_root ( VlHIKMTree const *  f)
inline
Parameters:
fHIKM tree.
Returns:
maximum number of iterations.
int vl_hikm_get_verbosity ( VlHIKMTree const *  f)
inline
Parameters:
fHIKM tree.
Returns:
verbosity level.
void vl_hikm_init ( VlHIKMTree f,
int  M,
int  K,
int  depth 
)
Parameters:
fHIKM tree.
MData dimensionality.
KNumber of clusters per node.
depthTree depth.
Remarks:
depth cannot be smaller than 1.
Returns:
a new HIKM tree representing the clustering.
VlHIKMTree* vl_hikm_new ( int  method)
Parameters:
methodclustering method.
Returns:
new HIKM tree.
void vl_hikm_push ( VlHIKMTree f,
vl_uint asgn,
vl_uint8 const *  data,
int  N 
)
Parameters:
fHIKM tree.
asgnPath down the tree (out).
dataData to project.
NNumber of data.

The function writes to asgn the path of the data data down the HIKM tree f. The parameter asgn must point to an array of M by N elements, where M is the depth of the HIKM tree and N is the number of data point to process.

void vl_hikm_set_max_niters ( VlHIKMTree f,
int  max_niters 
)
inline
Parameters:
fHIKM tree.
max_nitersmaximum number of iterations.
void vl_hikm_set_verbosity ( VlHIKMTree f,
int  verb 
)
inline
Parameters:
fHIKM tree.
verbverbosity level.
void vl_hikm_train ( VlHIKMTree f,
vl_uint8 const *  data,
int  N 
)
Parameters:
fHIKM tree.
dataData to cluster.
NNumber of data.