STK++ 0.9.13
|
Base class for the Gaussian Kernel Mixture Models. More...
#include <STK_KmmBase.h>
Public Types | |
typedef IMixtureDensity< Derived > | Base |
typedef hidden::MixtureTraits< Derived >::Array | Array |
![]() | |
typedef hidden::MixtureTraits< Derived >::Array | Array |
typedef hidden::MixtureTraits< Derived >::Parameters | Parameters |
typedef hidden::Traits< Array >::Type | Type |
Public Member Functions | |
Real | sigma2 (int k) const |
Real | dim (int k) const |
Kernel::IKernel const *const | p_kernel () const |
CArrayXX | dik () const |
void | setDim (Real const &dim) |
set the dimensions of the kernel mixture model using an unique value | |
template<class Vector > | |
void | setDim (ExprBase< Vector > const &dim) |
set the dimension of the kernel mixture model | |
void | setKernel (Kernel::IKernel const *p_kernel) |
set the dimensions of the kernel mixture model using an unique value. | |
template<class Weights > | |
Real | impute (int i, int j, Weights const &pk) const |
Real | rand (int i, int j, int k) const |
template<class ArrayParam > | |
void | getParameters (ArrayParam ¶ms) const |
This function is used in order to get the current values of the parameters in an array. | |
void | writeParameters (CArrayXX const *p_tik, ostream &os) const |
This function can be used to write summary of parameters to the output stream. | |
int | nbSample () const |
int | nbCluster () const |
![]() | |
~IMixtureDensity () | |
destructor | |
int | nbCluster () const |
int | nbSample () const |
Real | lnNbSample () const |
Array const *const & | p_data () const |
Parameters const & | param () const |
void | setData (Array const &data) |
Set the data set. | |
void | setData (Array const &data, int nbRow, int nbCol, bool byRow=true) |
Set the data set and give dimensions. | |
bool | initializeStep () |
This function will be called at the beginning of the estimation process once the model is created and data is set. | |
void | setParametersStep () |
set the parameters obtained with the intermediate results and release the intermediate results. | |
void | finalizeStep () |
This function will be called once the model is estimated. | |
template<class Weights > | |
Type | sample (int i, int j, Weights const &tk) const |
![]() | |
Derived & | asDerived () |
static cast : return a reference of this with a cast to the derived class. | |
Derived const & | asDerived () const |
static cast : return a const reference of this with a cast to the derived class. | |
Derived * | asPtrDerived () |
static cast : return a ptr on a Derived of this with a cast to the derived class. | |
Derived const * | asPtrDerived () const |
static cast : return a ptr on a constant Derived of this with a cast to the derived class. | |
Derived * | clone () const |
create a leaf using the copy constructor of the Derived class. | |
Derived * | clone (bool isRef) const |
create a leaf using the copy constructor of the Derived class and a flag determining if the clone is a reference or not. | |
Public Attributes | |
Parameters | param_ |
parameters of the derived mixture model. | |
Protected Member Functions | |
KmmBase (int nbCluster) | |
default constructor | |
KmmBase (KmmBase const &model) | |
copy constructor | |
~KmmBase () | |
destructor | |
void | initializeModel () |
Initialize the model before its first use. | |
void | compute_dik (CArrayXX const *p_tik, CPointX const *p_tk) |
compute the distance of the ith individual to the kth centroid | |
void | initializeModelImpl () |
default implementation of initializeModelImpl (do nothing) | |
![]() | |
IMixtureDensity (int nbCluster) | |
Default constructor. | |
IMixtureDensity (IMixtureDensity const &model) | |
copy constructor. | |
void | initializeModel () |
Initialize the model before its first use. | |
bool | initializeStepImpl () |
default implementation of initializeStepImpl (do nothing and return true) | |
void | finalizeStepImpl () |
default implementation of finalizeStepImpl (do nothing) | |
void | setNbSample (int nbSample) |
Set the number of sample of the model (needed by kernel models) | |
![]() | |
IRecursiveTemplate () | |
constructor. | |
~IRecursiveTemplate () | |
destructor. | |
Protected Attributes | |
Kernel::IKernel const * | p_kernel_ |
pointer on the kernel | |
CArrayXX | dik_ |
Array of the intermediate results dik. | |
![]() | |
Parameters | param_ |
parameters of the derived mixture model. | |
Private Member Functions | |
void | setData (Array const &data) |
Set the data set. | |
Base class for the Gaussian Kernel Mixture Models.
Definition at line 53 of file STK_KmmBase.h.
typedef hidden::MixtureTraits<Derived>::Array STK::KmmBase< Derived >::Array |
Definition at line 57 of file STK_KmmBase.h.
typedef IMixtureDensity<Derived > STK::KmmBase< Derived >::Base |
Definition at line 56 of file STK_KmmBase.h.
|
inlineprotected |
default constructor
nbCluster | number of cluster in the model |
Definition at line 67 of file STK_KmmBase.h.
|
inlineprotected |
|
inlineprotected |
|
protected |
compute the distance of the ith individual to the kth centroid
using the kernel trick.
Definition at line 172 of file STK_KmmBase.h.
References _T, STK::ICArray< Derived >::col(), and stk_cout.
|
inline |
Definition at line 88 of file STK_KmmBase.h.
References STK::KmmBase< Derived >::dik_.
|
inline |
Definition at line 84 of file STK_KmmBase.h.
References STK::KmmBase< Derived >::param_.
Referenced by STK::KmmBase< Derived >::setDim(), and STK::KmmBase< Derived >::setDim().
|
inline |
This function is used in order to get the current values of the parameters in an array.
[out] | params | the array with the parameters of the mixture. |
Definition at line 227 of file STK_KmmBase.h.
References STK::baseIdx.
|
inline |
i,j | indexes of the data to impute |
pk | the probabilities of each class for the ith individual |
Definition at line 116 of file STK_KmmBase.h.
|
protected |
Initialize the model before its first use.
This function is triggered when kernel is set. In this interface, the initializeModel()
method
Definition at line 211 of file STK_KmmBase.h.
Referenced by STK::KmmBase< Derived >::setKernel().
|
inlineprotected |
default implementation of initializeModelImpl (do nothing)
Definition at line 157 of file STK_KmmBase.h.
|
inline |
Definition at line 124 of file STK_IMixtureDensity.h.
|
inline |
Definition at line 126 of file STK_IMixtureDensity.h.
|
inline |
Definition at line 86 of file STK_KmmBase.h.
References STK::KmmBase< Derived >::p_kernel_.
Referenced by STK::KmmBase< Derived >::setKernel().
Definition at line 120 of file STK_KmmBase.h.
|
inlineprivate |
Set the data set.
method is re-implemented for debug purpose
data | the data set to set |
Definition at line 164 of file STK_KmmBase.h.
References STK::IMixtureDensity< Derived >::p_dataij_.
|
inline |
set the dimension of the kernel mixture model
Definition at line 95 of file STK_KmmBase.h.
References STK::KmmBase< Derived >::dim(), STK::KmmBase< Derived >::param_, and STK_STATIC_ASSERT_ONE_DIMENSION_ONLY.
|
inline |
set the dimensions of the kernel mixture model using an unique value
Definition at line 92 of file STK_KmmBase.h.
References STK::KmmBase< Derived >::dim(), and STK::KmmBase< Derived >::param_.
|
inline |
set the dimensions of the kernel mixture model using an unique value.
call to this method will triger the call to initializeModelImpl
(as setData will not be called)
Definition at line 105 of file STK_KmmBase.h.
References STK::KmmBase< Derived >::initializeModel(), STK::KmmBase< Derived >::p_kernel(), and STK::KmmBase< Derived >::p_kernel_.
|
inline |
Definition at line 82 of file STK_KmmBase.h.
References STK::KmmBase< Derived >::param_.
|
inline |
This function can be used to write summary of parameters to the output stream.
p_tik | a constant pointer on the posterior probabilities |
os | Stream where you want to write the summary of parameters. |
Definition at line 241 of file STK_KmmBase.h.
References _T.
|
protected |
Array of the intermediate results dik.
Definition at line 138 of file STK_KmmBase.h.
Referenced by STK::KmmBase< Derived >::dik().
|
protected |
pointer on the kernel
Definition at line 136 of file STK_KmmBase.h.
Referenced by STK::KmmBase< Derived >::p_kernel(), and STK::KmmBase< Derived >::setKernel().
Parameters STK::IMixtureDensity< Derived >::param_ |
parameters of the derived mixture model.
Should be an instance of the STK::ModelParameters struct.
Definition at line 180 of file STK_IMixtureDensity.h.
Referenced by STK::KmmBase< Derived >::dim(), STK::KmmBase< Derived >::setDim(), STK::KmmBase< Derived >::setDim(), and STK::KmmBase< Derived >::sigma2().