CHierarchical Class Reference

Inheritance diagram for CHierarchical:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 CHierarchical ()
 CHierarchical (int32_t merges, CDistance *d)
virtual ~CHierarchical ()
virtual EClassifierType get_classifier_type ()
virtual bool train ()
virtual bool load (FILE *srcfile)
virtual bool save (FILE *dstfile)
void set_merges (int32_t m)
int32_t get_merges ()
void get_assignment (int32_t *&assign, int32_t &num)
void get_merge_distance (float64_t *&dist, int32_t &num)
void get_merge_distances (float64_t **dist, int32_t *num)
void get_pairs (int32_t *&tuples, int32_t &rows, int32_t &num)
void get_cluster_pairs (int32_t **tuples, int32_t *rows, int32_t *num)

Protected Attributes

int32_t merges
 the number of merges in hierarchical clustering
int32_t dimensions
 number of dimensions
int32_t assignment_size
 size of assignment table
int32_t * assignment
 cluster assignment for the num_points
int32_t table_size
 size of the below tables
int32_t * pairs
 tuples of i/j
float64_tmerge_distance
 distance at which pair i/j was added


Detailed Description

Agglomerative hierarchical single linkage clustering. Starting with each object being assigned to its own cluster clusters are iteratively merged. Here the clusters are merged whose elements have minimum distance, i.e. the clusters A and B that obtain

\[ \min\{d({\bf x},{\bf x'}): {\bf x}\in {\cal A},{\bf x'}\in {\cal B}\} \]

are merged.

cf e.g. http://en.wikipedia.org/wiki/Data_clustering

Definition at line 35 of file Hierarchical.h.


Constructor & Destructor Documentation

CHierarchical::CHierarchical (  ) 

default constructor

Definition at line 30 of file Hierarchical.cpp.

CHierarchical::CHierarchical ( int32_t  merges,
CDistance d 
)

constructor

Parameters:
merges the merges
d distance

Definition at line 36 of file Hierarchical.cpp.

CHierarchical::~CHierarchical (  )  [virtual]

Definition at line 43 of file Hierarchical.cpp.


Member Function Documentation

void CHierarchical::get_assignment ( int32_t *&  assign,
int32_t &  num 
)

get assignment

Parameters:
assign current assignment is stored in here
num number of assignments is stored in here

Definition at line 99 of file Hierarchical.h.

virtual EClassifierType CHierarchical::get_classifier_type (  )  [virtual]

get classifier type

Returns:
classifier type HIERARCHICAL

Reimplemented from CClassifier.

Definition at line 53 of file Hierarchical.h.

void CHierarchical::get_cluster_pairs ( int32_t **  tuples,
int32_t *  rows,
int32_t *  num 
)

get cluster pairs (swig compatible)

Parameters:
tuples current pairs are stored in here
rows number of rows is stored in here
num number of pairs is stored in here

Definition at line 150 of file Hierarchical.h.

void CHierarchical::get_merge_distance ( float64_t *&  dist,
int32_t &  num 
)

get merge distance

Parameters:
dist current merge distance is stored in here
num number of merge distances is stored in here

Definition at line 110 of file Hierarchical.h.

void CHierarchical::get_merge_distances ( float64_t **  dist,
int32_t *  num 
)

get merge distances (swig compatible)

Parameters:
dist current merge distances is stored in here
num number of merge distances is stored in here

Definition at line 121 of file Hierarchical.h.

int32_t CHierarchical::get_merges (  ) 

get merges

Returns:
merges

Definition at line 89 of file Hierarchical.h.

void CHierarchical::get_pairs ( int32_t *&  tuples,
int32_t &  rows,
int32_t &  num 
)

get pairs

Parameters:
tuples current pairs are stored in here
rows number of rows is stored in here
num number of pairs is stored in here

Definition at line 137 of file Hierarchical.h.

bool CHierarchical::load ( FILE *  srcfile  )  [virtual]

load distance machine from file

Parameters:
srcfile file to load from
Returns:
if loading was successful

Reimplemented from CClassifier.

Definition at line 145 of file Hierarchical.cpp.

bool CHierarchical::save ( FILE *  dstfile  )  [virtual]

save distance machine to file

Parameters:
dstfile file to save to
Returns:
if saving was successful

Reimplemented from CClassifier.

Definition at line 150 of file Hierarchical.cpp.

void CHierarchical::set_merges ( int32_t  m  ) 

set merges

Parameters:
m new merges

Definition at line 79 of file Hierarchical.h.

bool CHierarchical::train (  )  [virtual]

train distance machine

Returns:
if training was successful

Reimplemented from CClassifier.

Definition at line 50 of file Hierarchical.cpp.


Member Data Documentation

int32_t* CHierarchical::assignment [protected]

cluster assignment for the num_points

Definition at line 173 of file Hierarchical.h.

int32_t CHierarchical::assignment_size [protected]

size of assignment table

Definition at line 170 of file Hierarchical.h.

int32_t CHierarchical::dimensions [protected]

number of dimensions

Definition at line 167 of file Hierarchical.h.

distance at which pair i/j was added

Definition at line 182 of file Hierarchical.h.

int32_t CHierarchical::merges [protected]

the number of merges in hierarchical clustering

Definition at line 164 of file Hierarchical.h.

int32_t* CHierarchical::pairs [protected]

tuples of i/j

Definition at line 179 of file Hierarchical.h.

int32_t CHierarchical::table_size [protected]

size of the below tables

Definition at line 176 of file Hierarchical.h.


The documentation for this class was generated from the following files:

SHOGUN Machine Learning Toolbox - Documentation