STK++ 0.9.13
|
Main interface class for mixture models. More...
#include <STK_IMixtureModel.h>
Public Types | |
typedef Clust::MixtureTraits< Derived >::Array | Array |
typedef Clust::MixtureTraits< Derived >::Parameters | Parameters |
typedef Array::Type | Type |
Public Member Functions | |
~IMixtureModel () | |
destructor | |
IMixtureModel * | create () const |
create pattern. | |
Array const * | p_data () const |
void | setData (Array const &data) |
Set the data set. | |
bool | initializeStep () |
This function will be called once the model is created and data is set. | |
void | setParametersStep () |
set the parameters stored in stat_proba_ and release stat_proba_. | |
void | finalizeStep () |
This function will be called once the model is estimated. | |
void | initializeModelImpl () |
default implementation of initializeModelImpl (do nothing) | |
bool | initializeStepImpl () |
default implementation of initializeStepImpl (return true) | |
void | finalizeStepImpl () |
default implementation of finalizeStepImpl (do nothing) | |
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. | |
![]() | |
IMixtureModelBase (int nbCluster) | |
default constructor | |
IMixtureModelBase (IMixtureModelBase const &model) | |
copy constructor. | |
~IMixtureModelBase () | |
destructor | |
int | nbCluster () const |
int | nbSample () const |
Real | lnNbSample () const |
Protected Member Functions | |
IMixtureModel (int nbCluster) | |
Default constructor. | |
IMixtureModel (IMixtureModel const &model) | |
copy constructor. | |
void | initializeModel () |
Initialize the model before its first use. | |
![]() | |
IRecursiveTemplate () | |
constructor. | |
~IRecursiveTemplate () | |
destructor. | |
![]() | |
void | setNbSample (int nbSample) |
Set the number of sample of the model. | |
Protected Attributes | |
Parameters | param_ |
parameters of the derived mixture model | |
Private Attributes | |
Array const * | p_dataij_ |
pointer on the data set | |
Main interface class for mixture models.
At this level we create the Parameters struct. The call to setData trigger the call to initializeModel which itself trigger a call to initializeModelImpl to the derived class.
The methods to implement in derived classes are
The pseudo virtual methods to implement if needed in derived classes are
Definition at line 93 of file STK_IMixtureModel.h.
typedef Clust::MixtureTraits<Derived>::Array STK::IMixtureModel< Derived >::Array |
Definition at line 96 of file STK_IMixtureModel.h.
typedef Clust::MixtureTraits<Derived>::Parameters STK::IMixtureModel< Derived >::Parameters |
Definition at line 97 of file STK_IMixtureModel.h.
typedef Array::Type STK::IMixtureModel< Derived >::Type |
Definition at line 98 of file STK_IMixtureModel.h.
|
inlineprotected |
Default constructor.
nbCluster | the number of cluster |
Definition at line 104 of file STK_IMixtureModel.h.
|
inlineprotected |
copy constructor.
model | the model to copy |
Definition at line 115 of file STK_IMixtureModel.h.
|
inline |
|
inline |
create pattern.
Definition at line 125 of file STK_IMixtureModel.h.
References STK::IMixtureModelBase::nbCluster().
|
inline |
This function will be called once the model is estimated.
perform specific model finalization stuff
Definition at line 151 of file STK_IMixtureModel.h.
References STK::IRecursiveTemplate< Derived >::asDerived().
|
inline |
default implementation of finalizeStepImpl (do nothing)
Definition at line 159 of file STK_IMixtureModel.h.
|
inlineprotected |
Initialize the model before its first use.
This function is triggered when data set is set. In this interface, the initializeModel()
method
Definition at line 180 of file STK_IMixtureModel.h.
References STK::IRecursiveTemplate< Derived >::asDerived(), STK::IMixtureModel< Derived >::p_dataij_, and STK::IMixtureModelBase::setNbSample().
Referenced by STK::IMixtureModel< Derived >::setData().
|
inline |
default implementation of initializeModelImpl (do nothing)
Definition at line 155 of file STK_IMixtureModel.h.
|
inline |
This function will be called once the model is created and data is set.
return
true. Definition at line 142 of file STK_IMixtureModel.h.
References STK::IRecursiveTemplate< Derived >::asDerived().
|
inline |
default implementation of initializeStepImpl (return true)
Definition at line 157 of file STK_IMixtureModel.h.
|
inline |
Definition at line 127 of file STK_IMixtureModel.h.
References STK::IMixtureModel< Derived >::p_dataij_.
|
inline |
i,j | indexes of the data to impute |
tk | the probabilities of each class for the ith individual |
Definition at line 166 of file STK_IMixtureModel.h.
References STK::IRecursiveTemplate< Derived >::asDerived(), and STK::Law::Categorical::rand().
|
inline |
Set the data set.
Setting a (new) data set will trigger the initialization process of the model.
data | the data set to set |
Definition at line 133 of file STK_IMixtureModel.h.
References STK::IMixtureModel< Derived >::initializeModel(), and STK::IMixtureModel< Derived >::p_dataij_.
|
inline |
set the parameters stored in stat_proba_ and release stat_proba_.
Definition at line 144 of file STK_IMixtureModel.h.
References STK::IRecursiveTemplate< Derived >::asDerived(), and STK::IMixtureModel< Derived >::param_.
|
private |
pointer on the data set
Definition at line 193 of file STK_IMixtureModel.h.
Referenced by STK::IMixtureModel< Derived >::initializeModel(), STK::IMixtureModel< Derived >::p_data(), and STK::IMixtureModel< Derived >::setData().
|
protected |
parameters of the derived mixture model
Definition at line 189 of file STK_IMixtureModel.h.
Referenced by STK::IMixtureModel< Derived >::setParametersStep().