# Changeset 813 for trunk/yat/classifier

Ignore:
Timestamp:
Mar 16, 2007, 8:30:02 PM (15 years ago)
Message:

Predict in NBC. Fixes #57

Location:
trunk/yat/classifier
Files:
2 edited

### Legend:

Unmodified
 r812 /** For each sample, calculate the probabilities the sample belong to the corresponding class. Each sample (column) in \a data is predicted and predictions are returned in the corresponding column in passed \a res. Each row in \a res corresponds to a class. The prediction is the estimated probability that sample belong to class \f$j \f$ \f$P_j = \frac{1}{Z}\prod_i{\frac{1}{\sigma_i}} \exp(\frac{w_i(x_i-\mu_i)^2}{\sigma_i^2})\f$, where \f$\mu_i \f$ and \f$\sigma_i^2 \f$ are the estimated mean and variance, respectively. If \a data is a MatrixLookup is equivalent to using all weight equal to unity. */ void predict(const DataLookup2D& data, utility::matrix& res) const;