Definition at line 20 of file Perceptron.h.
Public Member Functions | |
CPerceptron () | |
CPerceptron (CRealFeatures *traindat, CLabels *trainlab) | |
virtual | ~CPerceptron () |
virtual EClassifierType | get_classifier_type () |
virtual bool | train () |
void | set_learn_rate (DREAL r) |
set learn rate of gradient descent training algorithm | |
void | set_max_iter (INT i) |
set maximum number of iterations | |
virtual DREAL | classify_example (INT vec_idx) |
get output for example "vec_idx" | |
void | get_w (DREAL **dst_w, INT *dst_dims) |
void | set_w (DREAL *src_w, INT src_w_dim) |
void | set_bias (DREAL b) |
DREAL | get_bias () |
virtual bool | load (FILE *srcfile) |
virtual bool | save (FILE *dstfile) |
virtual CLabels * | classify (CLabels *output=NULL) |
virtual void | set_features (CRealFeatures *feat) |
virtual CRealFeatures * | get_features () |
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 Attributes | |
DREAL | learn_rate |
INT | max_iter |
INT | w_dim |
DREAL * | w |
DREAL | bias |
CRealFeatures * | features |
DREAL | max_train_time |
CLabels * | labels |
CPerceptron::CPerceptron | ( | ) |
default constructor
Definition at line 15 of file Perceptron.cpp.
CPerceptron::CPerceptron | ( | CRealFeatures * | traindat, | |
CLabels * | trainlab | |||
) |
constructor
traindat | training features | |
trainlab | labels for training features |
Definition at line 20 of file Perceptron.cpp.
CPerceptron::~CPerceptron | ( | ) | [virtual] |
Definition at line 27 of file Perceptron.cpp.
virtual EClassifierType CPerceptron::get_classifier_type | ( | ) | [virtual] |
get classifier type
Reimplemented from CClassifier.
Definition at line 38 of file Perceptron.h.
bool CPerceptron::train | ( | ) | [virtual] |
train classifier
Reimplemented from CClassifier.
Definition at line 31 of file Perceptron.cpp.
void CPerceptron::set_learn_rate | ( | DREAL | r | ) |
void CPerceptron::set_max_iter | ( | INT | i | ) |
get output for example "vec_idx"
Reimplemented from CClassifier.
Definition at line 30 of file LinearClassifier.h.
get w
dst_w | store w in this argument | |
dst_dims | dimension of w |
Definition at line 46 of file LinearClassifier.h.
set w
src_w | new w | |
src_w_dim | dimension of new w |
Definition at line 61 of file LinearClassifier.h.
void CLinearClassifier::set_bias | ( | DREAL | b | ) | [inherited] |
DREAL CLinearClassifier::get_bias | ( | ) | [inherited] |
bool CLinearClassifier::load | ( | FILE * | srcfile | ) | [virtual, inherited] |
load from file
srcfile | file to load from |
Reimplemented from CClassifier.
Definition at line 24 of file LinearClassifier.cpp.
bool CLinearClassifier::save | ( | FILE * | dstfile | ) | [virtual, inherited] |
save to file
dstfile | file to save to |
Reimplemented from CClassifier.
Definition at line 29 of file LinearClassifier.cpp.
classify all examples
output | resulting labels |
Reimplemented from CClassifier.
Definition at line 34 of file LinearClassifier.cpp.
virtual void CLinearClassifier::set_features | ( | CRealFeatures * | feat | ) | [virtual, inherited] |
virtual CRealFeatures* CLinearClassifier::get_features | ( | ) | [virtual, inherited] |
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.
DREAL CPerceptron::learn_rate [protected] |
learning rate
Definition at line 60 of file Perceptron.h.
INT CPerceptron::max_iter [protected] |
maximum number of iterations
Definition at line 62 of file Perceptron.h.
INT CLinearClassifier::w_dim [protected, inherited] |
dimension of w
Definition at line 125 of file LinearClassifier.h.
DREAL* CLinearClassifier::w [protected, inherited] |
w
Definition at line 127 of file LinearClassifier.h.
DREAL CLinearClassifier::bias [protected, inherited] |
bias
Definition at line 129 of file LinearClassifier.h.
CRealFeatures* CLinearClassifier::features [protected, inherited] |
features
Definition at line 131 of file LinearClassifier.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.