Ignore:
Timestamp:
Feb 28, 2008, 1:27:37 PM (14 years ago)
Author:
Peter
Message:

working on #335. Fixed weighted test data case. Left to fix is when there are missing features in training in other words what should happen when complete training cannot be done because lack of data. The current behavior is probably not optimal, but have to look into it in more detail.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/classifier/NBC.h

    r1169 r1182  
    104104       row in \a res corresponds to a class. The prediction is the
    105105       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.
    106116     */
    107117    void predict(const MatrixLookupWeighted& data, utility::Matrix& res) const;
Note: See TracChangeset for help on using the changeset viewer.