

Classes | |
| struct | ClassInfo |
Public Member Functions | |
| RecurBayes (uint numClasses, uint numFeatures, uint nfix) | |
| ~RecurBayes () | |
| Destructor. | |
| void | learn (std::vector< double > &fv, const char *name, uint fix) |
| Learn to associate a feature vector with a particuler class name. | |
| int | classify (std::vector< double > &fv, double *prob=NULL, uint fix=1) |
| classify a given feature vector | |
| double | getMean (uint cls, uint i, uint fix) |
| Get the mean for a particuler feature. | |
| double | getStdevSq (uint cls, uint i, uint fix) |
| Get the stdev Squared for a particuler feature. | |
| uint | getNumFeatures () |
| Get the number of features. | |
| uint | getNumClasses () |
| Get the number of classes. | |
| uint | getClassFreq (uint cls) |
| Get the Freq of a given class. | |
| double | getClassProb (uint cls) |
| Get the probability of a given class. | |
| double | getStatSig (std::vector< double > &fv, uint cls, uint fix) |
| return the statistical significent of the FV for a given class | |
| double | gauss (double x, double mean, double stdevSq) |
| Calculate a Normal Dist (use the srdev squared. | |
| void | save (const char *filename) |
| Save the network to a file. | |
| void | load (const char *filename) |
| Load the network from a file. | |
| void | setFeatureName (uint index, const char *name) |
| set feature name (for debuging) | |
| const char * | getFeatureName (const uint index) const |
| get feature name (for debuging) | |
| int | addClass (const char *name) |
| Add class by name and return its Id. | |
| const char * | getClassName (const uint id) |
| Get the class name from a given Id. | |
| int | getClassId (const char *name) |
| Get the class id from a given name. | |
Definition at line 46 of file RecurBayes.H.
Construct a bayes classifer with a given number of features and number of classes
Definition at line 51 of file RecurBayes.C.
| RecurBayes::~RecurBayes | ( | ) |
Destructor.
Definition at line 67 of file RecurBayes.C.
| int RecurBayes::addClass | ( | const char * | name | ) |
Add class by name and return its Id.
Definition at line 340 of file RecurBayes.C.
References getClassId().
Referenced by learn().
| int RecurBayes::classify | ( | std::vector< double > & | fv, | |
| double * | prob = NULL, |
|||
| uint | fix = 1 | |||
| ) |
classify a given feature vector
Definition at line 153 of file RecurBayes.C.
References exp(), gauss(), getClassProb(), log(), and max().
| double RecurBayes::gauss | ( | double | x, | |
| double | mean, | |||
| double | stdevSq | |||
| ) |
Calculate a Normal Dist (use the srdev squared.
Definition at line 216 of file RecurBayes.C.
Referenced by classify().
| int RecurBayes::getClassId | ( | const char * | name | ) |
Get the class id from a given name.
Definition at line 375 of file RecurBayes.C.
Referenced by addClass(), and learn().
| const char * RecurBayes::getClassName | ( | const uint | id | ) |
| double RecurBayes::getClassProb | ( | uint | cls | ) |
Get the probability of a given class.
Definition at line 139 of file RecurBayes.C.
References ASSERT.
Referenced by classify().
| const char * RecurBayes::getFeatureName | ( | const uint | index | ) | const |
Get the mean for a particuler feature.
Definition at line 106 of file RecurBayes.C.
References ASSERT.
| uint RecurBayes::getNumClasses | ( | ) |
Get the number of classes.
Definition at line 126 of file RecurBayes.C.
| uint RecurBayes::getNumFeatures | ( | ) |
Get the number of features.
Definition at line 120 of file RecurBayes.C.
| double RecurBayes::getStatSig | ( | std::vector< double > & | fv, | |
| uint | cls, | |||
| uint | fix | |||
| ) |
return the statistical significent of the FV for a given class
Definition at line 194 of file RecurBayes.C.
Get the stdev Squared for a particuler feature.
Definition at line 113 of file RecurBayes.C.
References ASSERT.
| void RecurBayes::learn | ( | std::vector< double > & | fv, | |
| const char * | name, | |||
| uint | fix | |||
| ) |
Learn to associate a feature vector with a particuler class name.
Definition at line 73 of file RecurBayes.C.
References addClass(), ASSERT, and getClassId().
| void RecurBayes::load | ( | const char * | filename | ) |
Load the network from a file.
Definition at line 265 of file RecurBayes.C.
| void RecurBayes::save | ( | const char * | filename | ) |
Save the network to a file.
Definition at line 223 of file RecurBayes.C.
| void RecurBayes::setFeatureName | ( | uint | index, | |
| const char * | name | |||
| ) |
1.6.3