GClasses

GClasses::GMixtureOfGaussians Class Reference

This class uses Expectency Maximization to find the mixture of Gaussians that best approximates the data in a specified real attribute of a data set. More...

#include <GMixtureOfGaussians.h>

List of all members.

Public Member Functions

 GMixtureOfGaussians (int nKernelCount, GMatrix *pData, int nAttribute, double minVariance, GRand *pRand)
virtual ~GMixtureOfGaussians ()
double iterate ()
 Returns the log likelihood of the current parameters.
void params (int nKernel, double *pMean, double *pVariance, double *pWeight)
 Returns the current parameters of the specified kernel.

Static Public Member Functions

static void test ()
 Performs unit tests for this class. Throws an exception if there is a failure.
static GMixtureOfGaussiansstochasticHammer (int nMinKernelCount, int nMaxKernelCount, int nItters, int nTrials, GMatrix *pData, int nAttribute, double minVariance, GRand *pRand)
 This tries to fit the data from several random starting points, and returns the best model it finds.

Protected Member Functions

double evalKernel (double x, int nKernel)
double likelihoodOfEachCategoryGivenThisFeature (double x)

Protected Attributes

int m_nKernelCount
int m_nAttribute
double * m_pArrMeanVarWeight
double * m_pCatLikelihoods
double * m_pTemp
GMatrixm_pData
GNormalDistribution m_dist
double m_dMinVariance

Detailed Description

This class uses Expectency Maximization to find the mixture of Gaussians that best approximates the data in a specified real attribute of a data set.


Constructor & Destructor Documentation

GClasses::GMixtureOfGaussians::GMixtureOfGaussians ( int  nKernelCount,
GMatrix pData,
int  nAttribute,
double  minVariance,
GRand pRand 
)
virtual GClasses::GMixtureOfGaussians::~GMixtureOfGaussians ( ) [virtual]

Member Function Documentation

double GClasses::GMixtureOfGaussians::evalKernel ( double  x,
int  nKernel 
) [protected]
double GClasses::GMixtureOfGaussians::iterate ( )

Returns the log likelihood of the current parameters.

double GClasses::GMixtureOfGaussians::likelihoodOfEachCategoryGivenThisFeature ( double  x) [protected]
void GClasses::GMixtureOfGaussians::params ( int  nKernel,
double *  pMean,
double *  pVariance,
double *  pWeight 
)

Returns the current parameters of the specified kernel.

static GMixtureOfGaussians* GClasses::GMixtureOfGaussians::stochasticHammer ( int  nMinKernelCount,
int  nMaxKernelCount,
int  nItters,
int  nTrials,
GMatrix pData,
int  nAttribute,
double  minVariance,
GRand pRand 
) [static]

This tries to fit the data from several random starting points, and returns the best model it finds.

static void GClasses::GMixtureOfGaussians::test ( ) [static]

Performs unit tests for this class. Throws an exception if there is a failure.


Member Data Documentation