GClasses
GClasses::GMixtureOfGaussians Class Reference

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.

#include <GMixtureOfGaussians.h>

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. More...
 
void params (int nKernel, double *pMean, double *pVariance, double *pWeight)
 Returns the current parameters of the specified kernel. More...
 

Static Public Member Functions

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. More...
 
static void test ()
 Performs unit tests for this class. Throws an exception if there is a failure. More...
 

Protected Member Functions

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

Protected Attributes

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

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

GNormalDistribution GClasses::GMixtureOfGaussians::m_dist
protected
double GClasses::GMixtureOfGaussians::m_dMinVariance
protected
int GClasses::GMixtureOfGaussians::m_nAttribute
protected
int GClasses::GMixtureOfGaussians::m_nKernelCount
protected
double* GClasses::GMixtureOfGaussians::m_pArrMeanVarWeight
protected
double* GClasses::GMixtureOfGaussians::m_pCatLikelihoods
protected
GMatrix* GClasses::GMixtureOfGaussians::m_pData
protected
double* GClasses::GMixtureOfGaussians::m_pTemp
protected