Changeset 1182 for trunk/yat/classifier/NBC.h
 Timestamp:
 Feb 28, 2008, 1:27:37 PM (15 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/yat/classifier/NBC.h
r1169 r1182 104 104 row in \a res corresponds to a class. The prediction is the 105 105 estimated probability that sample belong to class \f$ j \f$ 106 107 \f$ P_j = \frac{1}{Z}\prod_i\({\frac{1}{\sqrt{2\pi\sigma_i^2}}}\) 108 \exp(\frac{\sum{w_i(x_i\mu_i)^2}{\sigma_i^2}}{\sum w_i})\f$, 109 where \f$ \mu_i 110 \f$ and \f$ \sigma_i^2 \f$ are the estimated mean and variance, 111 respectively. If a \f$ \sigma_i \f$ could not be estimated 112 during training, corresponding factor is set to unity, in other 113 words, that feature is ignored for the prediction of that 114 particular class. Z is chosen such that total probability, \f$ 115 \sum P_j \f$, equals unity. 106 116 */ 107 117 void predict(const MatrixLookupWeighted& data, utility::Matrix& res) const;
Note: See TracChangeset
for help on using the changeset viewer.