Definition at line 25 of file KMeans.h.
Public Member Functions | |
CKMeans () | |
CKMeans (INT k, CDistance *d) | |
virtual | ~CKMeans () |
virtual EClassifierType | get_classifier_type () |
virtual bool | train () |
virtual bool | load (FILE *srcfile) |
virtual bool | save (FILE *dstfile) |
void | set_k (INT p_k) |
INT | get_k () |
void | set_max_iter (INT iter) |
DREAL | get_max_iter () |
void | get_radi (DREAL *&radi, INT &num) |
void | get_centers (DREAL *¢ers, INT &dim, INT &num) |
void | get_radiuses (DREAL **radii, INT *num) |
void | get_cluster_centers (DREAL **centers, INT *dim, INT *num) |
INT | get_dimensions () |
void | set_distance (CDistance *d) |
CDistance * | get_distance () |
virtual CLabels * | classify (CLabels *output=NULL) |
virtual DREAL | classify_example (INT num) |
virtual void | set_labels (CLabels *lab) |
virtual CLabels * | get_labels () |
virtual DREAL | get_label (INT i) |
void | set_max_train_time (DREAL t) |
DREAL | get_max_train_time () |
Static Public Attributes | |
static CParallel | parallel |
static CIO | io |
static CVersion | version |
Protected Member Functions | |
void | sqdist (double *x, CRealFeatures *y, double *z, int n1, int offs, int n2, int m) |
void | clustknb (bool use_old_mus, double *mus_start) |
Protected Attributes | |
INT | max_iter |
maximum number of iterations | |
INT | k |
the k parameter in KMeans | |
INT | dimensions |
number of dimensions | |
DREAL * | R |
radi of the clusters (size k) | |
DREAL * | mus |
centers of the clusters (size dimensions x k) | |
CDistance * | distance |
DREAL | max_train_time |
CLabels * | labels |
CKMeans::CKMeans | ( | ) |
default constructor
Definition at line 27 of file KMeans.cpp.
CKMeans::~CKMeans | ( | ) | [virtual] |
Definition at line 40 of file KMeans.cpp.
virtual EClassifierType CKMeans::get_classifier_type | ( | ) | [virtual] |
bool CKMeans::train | ( | ) | [virtual] |
train distance machine
Reimplemented from CClassifier.
Definition at line 46 of file KMeans.cpp.
bool CKMeans::load | ( | FILE * | srcfile | ) | [virtual] |
load distance machine from file
srcfile | file to load from |
Reimplemented from CClassifier.
Definition at line 66 of file KMeans.cpp.
bool CKMeans::save | ( | FILE * | dstfile | ) | [virtual] |
save distance machine to file
dstfile | file to save to |
Reimplemented from CClassifier.
Definition at line 71 of file KMeans.cpp.
void CKMeans::set_max_iter | ( | INT | iter | ) |
DREAL CKMeans::get_max_iter | ( | ) |
INT CKMeans::get_dimensions | ( | ) |
void CKMeans::sqdist | ( | double * | x, | |
CRealFeatures * | y, | |||
double * | z, | |||
int | n1, | |||
int | offs, | |||
int | n2, | |||
int | m | |||
) | [protected] |
sqdist
x | x | |
y | y | |
z | z | |
n1 | n1 | |
offs | offset | |
n2 | n2 | |
m | m |
Definition at line 118 of file KMeans.cpp.
void CKMeans::clustknb | ( | bool | use_old_mus, | |
double * | mus_start | |||
) | [protected] |
clustknb
use_old_mus | if old mus shall be used | |
mus_start | mus start |
Definition at line 162 of file KMeans.cpp.
void CDistanceMachine::set_distance | ( | CDistance * | d | ) | [inherited] |
CDistance* CDistanceMachine::get_distance | ( | ) | [inherited] |
classify object
output | classified labels |
Reimplemented in CKNN, CLinearClassifier, CPluginEstimate, CSparseLinearClassifier, CMultiClassSVM, CSVM, CWDSVMOcas, and CKernelMachine.
Definition at line 22 of file Classifier.cpp.
classify one example
abstract base method
num | which example to classify |
Reimplemented in CKernelPerceptron, CKNN, CLinearClassifier, CPluginEstimate, CSparseLinearClassifier, CMultiClassSVM, CSVM, and CWDSVMOcas.
Definition at line 47 of file Classifier.h.
virtual void CClassifier::set_labels | ( | CLabels * | lab | ) | [virtual, inherited] |
virtual CLabels* CClassifier::get_labels | ( | ) | [virtual, inherited] |
get one specific label
i | index of label to get |
Definition at line 89 of file Classifier.h.
void CClassifier::set_max_train_time | ( | DREAL | t | ) | [inherited] |
set maximum training time
t | maximimum training time |
Definition at line 95 of file Classifier.h.
DREAL CClassifier::get_max_train_time | ( | ) | [inherited] |
get maximum training time
Definition at line 101 of file Classifier.h.
INT CKMeans::max_iter [protected] |
INT CKMeans::k [protected] |
INT CKMeans::dimensions [protected] |
DREAL* CKMeans::R [protected] |
DREAL* CKMeans::mus [protected] |
CDistance* CDistanceMachine::distance [protected, inherited] |
the distance
Definition at line 49 of file DistanceMachine.h.
DREAL CClassifier::max_train_time [protected, inherited] |
maximum training time
Definition at line 111 of file Classifier.h.
CLabels* CClassifier::labels [protected, inherited] |
labels
Definition at line 114 of file Classifier.h.
CParallel CSGObject::parallel [static, inherited] |
Definition at line 105 of file SGObject.h.
CIO CSGObject::io [static, inherited] |
Definition at line 106 of file SGObject.h.
CVersion CSGObject::version [static, inherited] |
Definition at line 107 of file SGObject.h.