SvmSgd Class Reference

Class for maintaining svm model. More...

#include <sgd_model.h>

List of all members.

Public Member Functions

 SvmSgd (int dim, double lambda)
 SvmSgd constructor.
void scale ()
 Scales model with wscale.
modelget_model ()
 Retrieves model learnt.
void test_example (char *newfeature)
 Tests given example in svm format and check whether prediction is correct or not.
double getAccuracy ()
 Returns accuracy on test data.
bool isExampleCorrectlyClassified (std::string newfeature)
 Checks whether given example is classified correctly or not.

Private Attributes

int _dim
model _current
int ex
 number of predictions
int match
 number of correct prediction during testing
Incremental_SGD * sgd
 Updates old model.


Detailed Description

Class for maintaining svm model.


Constructor & Destructor Documentation

SvmSgd::SvmSgd ( int  dim,
double  lambda 
)

SvmSgd constructor.

Parameters:
[in] dim dimension of the model
[in] lambda lambda of the sgd learning


Member Function Documentation

struct model& SvmSgd::get_model (  )  [inline]

Retrieves model learnt.

Returns:
model learnt

double SvmSgd::getAccuracy (  ) 

Returns accuracy on test data.

Returns:
accuracy on test data

bool SvmSgd::isExampleCorrectlyClassified ( std::string  newfeature  ) 

Checks whether given example is classified correctly or not.

Returns:
whether example is correctly classified by the current model or not

void SvmSgd::scale (  ) 

Scales model with wscale.

void SvmSgd::test_example ( char *  featurechar  ) 

Tests given example in svm format and check whether prediction is correct or not.

Parameters:
[in] featurechar feature vector of the entity in svm format


Member Data Documentation

model SvmSgd::_current [private]

int SvmSgd::_dim [private]

int SvmSgd::ex [private]

number of predictions

int SvmSgd::match [private]

number of correct prediction during testing

Incremental_SGD* SvmSgd::sgd [private]

Updates old model.


The documentation for this class was generated from the following files:
Generated on Wed Dec 15 10:46:16 2010 for Hazy_System by  doxygen 1.4.7