#include <sgd_model.h>
Public Member Functions | |
| SvmSgd (int dim, double lambda) | |
| SvmSgd constructor. | |
| void | scale () |
| Scales model with wscale. | |
| model & | get_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. | |
| SvmSgd::SvmSgd | ( | int | dim, | |
| double | lambda | |||
| ) |
SvmSgd constructor.
| [in] | dim | dimension of the model |
| [in] | lambda | lambda of the sgd learning |
| struct model& SvmSgd::get_model | ( | ) | [inline] |
Retrieves model learnt.
| double SvmSgd::getAccuracy | ( | ) |
Returns accuracy on test data.
| bool SvmSgd::isExampleCorrectlyClassified | ( | std::string | newfeature | ) |
Checks whether given example is classified correctly 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.
| [in] | featurechar | feature vector of the entity in svm format |
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.
1.4.7