Ignore:
Timestamp:
Feb 22, 2007, 4:14:40 PM (15 years ago)
Author:
Peter
Message:

Fixes #65

File:
1 edited

Legend:

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

    r722 r767  
    3838  class Target;
    3939
    40   ///
    41   /// @brief Naive Bayesian Classification.
    42   ///
     40  /**
     41     @brief Naive Bayesian Classification.
     42 
     43     Each class is modelled as a multinormal distribution with
     44     features being independent: \f$ p(x|c) = \prod
     45     \frac{1}{\sqrt{2\pi\sigma_i^2}} \exp \left(
     46     \frac{(x_i-m_i)^2}{2\sigma_i^2)} \right)\f$
     47  */
    4348  class NBC : public SupervisedClassifier
    4449  {
     
    6974    /// Train the classifier using the training data.
    7075    ///
     76    /// For each class mean and variance are estimated for each
     77    /// feature (see Averager and AveragerWeighted for details).
     78    ///
    7179    /// @return true if training succedeed.
    7280    ///
     
    7886    /// to the corresponding class.
    7987    ///
    80     void predict(const DataLookup2D&, utility::matrix&) const;
     88    void predict(const DataLookup2D& data, utility::matrix& res) const;
    8189
    8290
    8391  private:
     92    double gaussian(double x, double m, double sigma) const;
     93
    8494    utility::matrix centroids_;
    8595    utility::matrix sigma_;
Note: See TracChangeset for help on using the changeset viewer.