A kernel machine is defined as
where is the number of training examples
are the weights assigned to each training example
is the kernel and
the bias.
Using an a-priori choosen kernel, the and bias are determined in a training procedure.
Definition at line 38 of file KernelMachine.h.
Public Member Functions | |
CKernelMachine () | |
virtual | ~CKernelMachine () |
void | set_kernel (CKernel *k) |
CKernel * | get_kernel () |
void | set_batch_computation_enabled (bool enable) |
bool | get_batch_computation_enabled () |
void | set_linadd_enabled (bool enable) |
bool | get_linadd_enabled () |
virtual CLabels * | classify (CLabels *output=NULL) |
virtual bool | train () |
virtual DREAL | classify_example (INT num) |
virtual bool | load (FILE *srcfile) |
virtual bool | save (FILE *dstfile) |
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 () |
virtual EClassifierType | get_classifier_type () |
Static Public Attributes | |
static CParallel | parallel |
static CIO | io |
static CVersion | version |
Protected Attributes | |
CKernel * | kernel |
bool | use_batch_computation |
bool | use_linadd |
DREAL | max_train_time |
CLabels * | labels |
CKernelMachine::CKernelMachine | ( | ) |
default constructor
Definition at line 13 of file KernelMachine.cpp.
CKernelMachine::~CKernelMachine | ( | ) | [virtual] |
destructor
Definition at line 18 of file KernelMachine.cpp.
void CKernelMachine::set_kernel | ( | CKernel * | k | ) |
CKernel* CKernelMachine::get_kernel | ( | ) |
void CKernelMachine::set_batch_computation_enabled | ( | bool | enable | ) |
set batch computation enabled
enable | if batch computation shall be enabled |
Definition at line 72 of file KernelMachine.h.
bool CKernelMachine::get_batch_computation_enabled | ( | ) |
check if batch computation is enabled
Definition at line 81 of file KernelMachine.h.
void CKernelMachine::set_linadd_enabled | ( | bool | enable | ) |
set linadd enabled
enable | if linadd shall be enabled |
Definition at line 90 of file KernelMachine.h.
bool CKernelMachine::get_linadd_enabled | ( | ) |
check if linadd is enabled
Definition at line 99 of file KernelMachine.h.
classify kernel machine
output | where resuling labels are stored |
Reimplemented from CClassifier.
Reimplemented in CMultiClassSVM, and CSVM.
Definition at line 23 of file KernelMachine.cpp.
virtual bool CClassifier::train | ( | ) | [virtual, inherited] |
train classifier
Reimplemented in CKernelPerceptron, CKNN, CPerceptron, CPluginEstimate, CGMNPSVM, CGNPPSVM, CGPBTSVM, CLibSVM, CLibSVMMultiClass, CLibSVMOneClass, CMPDSVM, CSubGradientSVM, CSVMLin, CSVMOcas, CSVMSGD, CWDSVMOcas, CHierarchical, CKMeans, and CLibSVR.
Definition at line 31 of file Classifier.h.
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 bool CClassifier::load | ( | FILE * | srcfile | ) | [virtual, inherited] |
load Classifier from file
abstract base method
srcfile | file to load from |
Reimplemented in CKernelPerceptron, CKNN, CLinearClassifier, CSVM, CHierarchical, and CKMeans.
Definition at line 56 of file Classifier.h.
virtual bool CClassifier::save | ( | FILE * | dstfile | ) | [virtual, inherited] |
save Classifier to file
abstract base method
dstfile | file to save to |
Reimplemented in CKernelPerceptron, CKNN, CLinearClassifier, CSVM, CHierarchical, and CKMeans.
Definition at line 65 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.
virtual EClassifierType CClassifier::get_classifier_type | ( | ) | [virtual, inherited] |
get classifier type
Reimplemented in CKernelPerceptron, CKNN, CPerceptron, CGMNPSVM, CGNPPSVM, CGPBTSVM, CLibSVM, CLibSVMMultiClass, CLibSVMOneClass, CMPDSVM, CSubGradientSVM, CSVMLin, CSVMOcas, CSVMSGD, CWDSVMOcas, CHierarchical, CKMeans, and CLibSVR.
Definition at line 107 of file Classifier.h.
CKernel* CKernelMachine::kernel [protected] |
kernel
Definition at line 113 of file KernelMachine.h.
bool CKernelMachine::use_batch_computation [protected] |
if batch computation is enabled
Definition at line 115 of file KernelMachine.h.
bool CKernelMachine::use_linadd [protected] |
if linadd is enabled
Definition at line 117 of file KernelMachine.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.