CGPBTSVM Class Reference

Inheritance diagram for CGPBTSVM:

Inheritance graph
[legend]

List of all members.


Detailed Description

class GPBTSVM

Definition at line 20 of file GPBTSVM.h.


Public Member Functions

 CGPBTSVM ()
 CGPBTSVM (DREAL C, CKernel *k, CLabels *lab)
virtual ~CGPBTSVM ()
virtual bool train ()
virtual EClassifierType get_classifier_type ()
void set_defaults (INT num_sv=0)
bool load (FILE *svm_file)
bool save (FILE *svm_file)
void set_nu (DREAL nue)
void set_C (DREAL c1, DREAL c2)
void set_weight_epsilon (DREAL eps)
void set_epsilon (DREAL eps)
void set_tube_epsilon (DREAL eps)
void set_C_mkl (DREAL C)
void set_qpsize (INT qps)
void set_bias_enabled (bool enable_bias)
bool get_bias_enabled ()
DREAL get_weight_epsilon ()
DREAL get_epsilon ()
DREAL get_nu ()
DREAL get_C1 ()
DREAL get_C2 ()
int get_qpsize ()
int get_support_vector (INT idx)
DREAL get_alpha (INT idx)
bool set_support_vector (INT idx, INT val)
bool set_alpha (INT idx, DREAL val)
DREAL get_bias ()
void set_bias (DREAL bias)
int get_num_support_vectors ()
void set_alphas (DREAL *alphas, INT d)
void set_support_vectors (INT *svs, INT d)
void get_support_vectors (INT **svs, INT *num)
void get_alphas (DREAL **alphas, INT *d1)
bool create_new_model (INT num)
void set_shrinking_enabled (bool enable)
bool get_shrinking_enabled ()
void set_mkl_enabled (bool enable)
bool get_mkl_enabled ()
DREAL compute_objective ()
void set_objective (DREAL v)
DREAL get_objective ()
bool init_kernel_optimization ()
virtual CLabelsclassify (CLabels *lab=NULL)
virtual DREAL classify_example (INT num)
void set_precomputed_subkernels_enabled (bool flag)
void set_kernel (CKernel *k)
CKernelget_kernel ()
void set_batch_computation_enabled (bool enable)
bool get_batch_computation_enabled ()
void set_linadd_enabled (bool enable)
bool get_linadd_enabled ()
virtual void set_labels (CLabels *lab)
virtual CLabelsget_labels ()
virtual DREAL get_label (INT i)
void set_max_train_time (DREAL t)
DREAL get_max_train_time ()

Static Public Member Functions

static void * classify_example_helper (void *p)

Static Public Attributes

static CParallel parallel
static CIO io
static CVersion version

Protected Attributes

struct svm_modelmodel
TModel svm_model
bool svm_loaded
DREAL weight_epsilon
DREAL epsilon
DREAL tube_epsilon
DREAL nu
DREAL C1
DREAL C2
DREAL C_mkl
DREAL objective
int qpsize
bool use_bias
bool use_shrinking
bool use_mkl
bool use_precomputed_subkernels
CKernelkernel
bool use_batch_computation
bool use_linadd
DREAL max_train_time
CLabelslabels

Constructor & Destructor Documentation

CGPBTSVM::CGPBTSVM (  ) 

default constructor

Definition at line 16 of file GPBTSVM.cpp.

CGPBTSVM::CGPBTSVM ( DREAL  C,
CKernel k,
CLabels lab 
)

constructor

Parameters:
C constant C
k kernel
lab labels

Definition at line 21 of file GPBTSVM.cpp.

CGPBTSVM::~CGPBTSVM (  )  [virtual]

Definition at line 26 of file GPBTSVM.cpp.


Member Function Documentation

bool CGPBTSVM::train (  )  [virtual]

train SVM

Returns:
if training was successful

Reimplemented from CClassifier.

Definition at line 31 of file GPBTSVM.cpp.

virtual EClassifierType CGPBTSVM::get_classifier_type (  )  [virtual]

get classifier type

Returns:
classifier type GPBT

Reimplemented from CClassifier.

Definition at line 45 of file GPBTSVM.h.

void CSVM::set_defaults ( INT  num_sv = 0  )  [inherited]

set default values for members a SVM object

Definition at line 56 of file SVM.cpp.

bool CSVM::load ( FILE *  svm_file  )  [virtual, inherited]

load a SVM from file

Parameters:
svm_file the file handle

Reimplemented from CClassifier.

Definition at line 87 of file SVM.cpp.

bool CSVM::save ( FILE *  svm_file  )  [virtual, inherited]

write a SVM to a file

Parameters:
svm_file the file handle

Reimplemented from CClassifier.

Definition at line 200 of file SVM.cpp.

void CSVM::set_nu ( DREAL  nue  )  [inherited]

set nu

Parameters:
nue new nu

Definition at line 79 of file SVM.h.

void CSVM::set_C ( DREAL  c1,
DREAL  c2 
) [inherited]

set C

Parameters:
c1 new C1
c2 new C2

Definition at line 86 of file SVM.h.

void CSVM::set_weight_epsilon ( DREAL  eps  )  [inherited]

set epsilon for weights

Parameters:
eps new weight_epsilon

Definition at line 92 of file SVM.h.

void CSVM::set_epsilon ( DREAL  eps  )  [inherited]

set epsilon

Parameters:
eps new epsilon

Definition at line 98 of file SVM.h.

void CSVM::set_tube_epsilon ( DREAL  eps  )  [inherited]

set tube epsilon

Parameters:
eps new tube epsilon

Definition at line 104 of file SVM.h.

void CSVM::set_C_mkl ( DREAL  C  )  [inherited]

set C mkl

Parameters:
C new C_mkl

Definition at line 110 of file SVM.h.

void CSVM::set_qpsize ( INT  qps  )  [inherited]

set qpsize

Parameters:
qps new qpsize

Definition at line 116 of file SVM.h.

void CSVM::set_bias_enabled ( bool  enable_bias  )  [inherited]

set state of bias

Parameters:
enable_bias if bias shall be enabled

Definition at line 122 of file SVM.h.

bool CSVM::get_bias_enabled (  )  [inherited]

get state of bias

Returns:
state of bias

Definition at line 128 of file SVM.h.

DREAL CSVM::get_weight_epsilon (  )  [inherited]

get epsilon for weights

Returns:
epsilon for weights

Definition at line 134 of file SVM.h.

DREAL CSVM::get_epsilon (  )  [inherited]

get epsilon

Returns:
epsilon

Definition at line 140 of file SVM.h.

DREAL CSVM::get_nu (  )  [inherited]

get nu

Returns:
nu

Definition at line 146 of file SVM.h.

DREAL CSVM::get_C1 (  )  [inherited]

get C1

Returns:
C1

Definition at line 152 of file SVM.h.

DREAL CSVM::get_C2 (  )  [inherited]

get C2

Returns:
C2

Definition at line 158 of file SVM.h.

int CSVM::get_qpsize (  )  [inherited]

get qpsize

Returns:
qpsize

Definition at line 164 of file SVM.h.

int CSVM::get_support_vector ( INT  idx  )  [inherited]

get support vector at given index

Parameters:
idx index of support vector
Returns:
support vector

Definition at line 171 of file SVM.h.

DREAL CSVM::get_alpha ( INT  idx  )  [inherited]

get alpha at given index

Parameters:
idx index of alpha
Returns:
alpha

Definition at line 182 of file SVM.h.

bool CSVM::set_support_vector ( INT  idx,
INT  val 
) [inherited]

set support vector at given index to given value

Parameters:
idx index of support vector
val new value of support vector
Returns:
if operation was successful

Definition at line 194 of file SVM.h.

bool CSVM::set_alpha ( INT  idx,
DREAL  val 
) [inherited]

set alpha at given index to given value

Parameters:
idx index of alpha vector
val new value of alpha vector
Returns:
if operation was successful

Definition at line 210 of file SVM.h.

DREAL CSVM::get_bias (  )  [inherited]

get bias

Returns:
bias

Definition at line 224 of file SVM.h.

void CSVM::set_bias ( DREAL  bias  )  [inherited]

set bias to given value

Parameters:
bias new bias

Definition at line 233 of file SVM.h.

int CSVM::get_num_support_vectors (  )  [inherited]

get number of support vectors

Returns:
number of support vectors

Definition at line 242 of file SVM.h.

void CSVM::set_alphas ( DREAL alphas,
INT  d 
) [inherited]

set alphas to given values

Parameters:
alphas array with all alphas to set
d number of alphas (== number of support vectors)

Definition at line 252 of file SVM.h.

void CSVM::set_support_vectors ( INT svs,
INT  d 
) [inherited]

set support vectors to given values

Parameters:
svs array with all support vectors to set
d number of support vectors

Definition at line 266 of file SVM.h.

void CSVM::get_support_vectors ( INT **  svs,
INT num 
) [inherited]

get all support vectors (swig compatible)

Parameters:
svs array to contain a copy of the support vectors
num number of support vectors in the array

Definition at line 280 of file SVM.h.

void CSVM::get_alphas ( DREAL **  alphas,
INT d1 
) [inherited]

get all alphas (swig compatible)

Parameters:
alphas array to contain a copy of the alphas
d1 number of alphas in the array

Definition at line 301 of file SVM.h.

bool CSVM::create_new_model ( INT  num  )  [inherited]

create new model

Parameters:
num number of alphas and support vectors in new model

Definition at line 321 of file SVM.h.

void CSVM::set_shrinking_enabled ( bool  enable  )  [inherited]

set state of shrinking

Parameters:
enable if shrinking will be enabled

Definition at line 347 of file SVM.h.

bool CSVM::get_shrinking_enabled (  )  [inherited]

get state of shrinking

Returns:
if shrinking is enabled

Definition at line 356 of file SVM.h.

void CSVM::set_mkl_enabled ( bool  enable  )  [inherited]

set state of mkl

Parameters:
enable if mkl shall be enabled

Definition at line 365 of file SVM.h.

bool CSVM::get_mkl_enabled (  )  [inherited]

get state of mkl

Returns:
if mkl is enabled

Definition at line 374 of file SVM.h.

DREAL CSVM::compute_objective (  )  [inherited]

compute objective

Returns:
computed objective

Definition at line 412 of file SVM.cpp.

void CSVM::set_objective ( DREAL  v  )  [inherited]

set objective

Parameters:
v objective

Definition at line 389 of file SVM.h.

DREAL CSVM::get_objective (  )  [inherited]

get objective

Returns:
objective

Definition at line 398 of file SVM.h.

bool CSVM::init_kernel_optimization (  )  [inherited]

initialise kernel optimisation

Returns:
if operation was successful

Definition at line 220 of file SVM.cpp.

CLabels * CSVM::classify ( CLabels lab = NULL  )  [virtual, inherited]

classify SVM

Parameters:
lab classified labels
Returns:
classified labels

Reimplemented from CKernelMachine.

Reimplemented in CMultiClassSVM.

Definition at line 279 of file SVM.cpp.

DREAL CSVM::classify_example ( INT  num  )  [virtual, inherited]

classify one example

Parameters:
num which example to classify
Returns:
classified value

Reimplemented from CClassifier.

Reimplemented in CMultiClassSVM.

Definition at line 392 of file SVM.cpp.

void * CSVM::classify_example_helper ( void *  p  )  [static, inherited]

classify example helper, used in threads

Parameters:
p params of the thread
Returns:
nothing really

Definition at line 251 of file SVM.cpp.

void CSVM::set_precomputed_subkernels_enabled ( bool  flag  )  [inherited]

set state of precomputed subkernels

Parameters:
flag if precomputed subkernels shall be enabled

Definition at line 434 of file SVM.h.

void CKernelMachine::set_kernel ( CKernel k  )  [inherited]

set kernel

Parameters:
k kernel

Definition at line 51 of file KernelMachine.h.

CKernel* CKernelMachine::get_kernel (  )  [inherited]

get kernel

Returns:
kernel

Definition at line 62 of file KernelMachine.h.

void CKernelMachine::set_batch_computation_enabled ( bool  enable  )  [inherited]

set batch computation enabled

Parameters:
enable if batch computation shall be enabled

Definition at line 72 of file KernelMachine.h.

bool CKernelMachine::get_batch_computation_enabled (  )  [inherited]

check if batch computation is enabled

Returns:
if batch computation is enabled

Definition at line 81 of file KernelMachine.h.

void CKernelMachine::set_linadd_enabled ( bool  enable  )  [inherited]

set linadd enabled

Parameters:
enable if linadd shall be enabled

Definition at line 90 of file KernelMachine.h.

bool CKernelMachine::get_linadd_enabled (  )  [inherited]

check if linadd is enabled

Returns:
if linadd is enabled

Definition at line 99 of file KernelMachine.h.

virtual void CClassifier::set_labels ( CLabels lab  )  [virtual, inherited]

set labels

Parameters:
lab labels

Definition at line 71 of file Classifier.h.

virtual CLabels* CClassifier::get_labels (  )  [virtual, inherited]

get labels

Returns:
labels

Definition at line 82 of file Classifier.h.

virtual DREAL CClassifier::get_label ( INT  i  )  [virtual, inherited]

get one specific label

Parameters:
i index of label to get
Returns:
value of label at index i

Definition at line 89 of file Classifier.h.

void CClassifier::set_max_train_time ( DREAL  t  )  [inherited]

set maximum training time

Parameters:
t maximimum training time

Definition at line 95 of file Classifier.h.

DREAL CClassifier::get_max_train_time (  )  [inherited]

get maximum training time

Returns:
maximum training time

Definition at line 101 of file Classifier.h.


Member Data Documentation

struct svm_model* CGPBTSVM::model [read, protected]

SVM model

Definition at line 49 of file GPBTSVM.h.

TModel CSVM::svm_model [protected, inherited]

SVM's model

Definition at line 455 of file SVM.h.

bool CSVM::svm_loaded [protected, inherited]

if SVM is loaded

Definition at line 457 of file SVM.h.

DREAL CSVM::weight_epsilon [protected, inherited]

epsilon of weights

Definition at line 459 of file SVM.h.

DREAL CSVM::epsilon [protected, inherited]

epsilon

Definition at line 461 of file SVM.h.

DREAL CSVM::tube_epsilon [protected, inherited]

tube epsilon

Definition at line 463 of file SVM.h.

DREAL CSVM::nu [protected, inherited]

nu

Definition at line 465 of file SVM.h.

DREAL CSVM::C1 [protected, inherited]

C1

Definition at line 467 of file SVM.h.

DREAL CSVM::C2 [protected, inherited]

C2

Definition at line 469 of file SVM.h.

DREAL CSVM::C_mkl [protected, inherited]

C_mkl

Definition at line 471 of file SVM.h.

DREAL CSVM::objective [protected, inherited]

objective

Definition at line 473 of file SVM.h.

int CSVM::qpsize [protected, inherited]

qpsize

Definition at line 475 of file SVM.h.

bool CSVM::use_bias [protected, inherited]

if bias shall be used

Definition at line 477 of file SVM.h.

bool CSVM::use_shrinking [protected, inherited]

if shrinking shall be used

Definition at line 479 of file SVM.h.

bool CSVM::use_mkl [protected, inherited]

if mkl shall be used

Definition at line 481 of file SVM.h.

bool CSVM::use_precomputed_subkernels [protected, inherited]

if precomputed subkernels shall be used

Definition at line 483 of file SVM.h.

CKernel* CKernelMachine::kernel [protected, inherited]

kernel

Definition at line 113 of file KernelMachine.h.

bool CKernelMachine::use_batch_computation [protected, inherited]

if batch computation is enabled

Definition at line 115 of file KernelMachine.h.

bool CKernelMachine::use_linadd [protected, inherited]

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.


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

SHOGUN Machine Learning Toolbox - Documentation