STK++ 0.9.13
|
template implementation of the IMixture interface allowing to bridge a STK++ mixture with the composer. More...
#include <STK_HDGaussianBridge.h>
Public Member Functions | |
HDGaussianBridge (Data *p_dataij, String const &idData, int nbCluster) | |
default constructor. | |
HDGaussianBridge (HDGaussianBridge const &bridge) | |
copy constructor | |
virtual | ~HDGaussianBridge () |
destructor | |
virtual HDGaussianBridge * | clone () const |
This is a standard clone function in usual sense. | |
virtual HDGaussianBridge * | create () const |
This is a standard create function in usual sense. | |
Type | safeValue (int j) const |
![]() | |
Mixture const & | mixture () const |
MissingIndexes const & | v_missing () const |
Data *const | p_dataij () const |
int | nbMissing () const |
void | getMissingValues (MissingValues &data) const |
get the (imputed) missing values of a data set. | |
void | getParameters (Parameters ¶m) const |
get the parameters of the model | |
void | getParameters (Array ¶m) const |
This function is used in order to get the current values of the parameters in an array. | |
void | setParameters (Parameters const ¶m) |
set the parameters of the model | |
void | setParameters (ExprBase< Array > const ¶m) |
This function is used in order to set the current values of the parameters to the parameters using an array. | |
virtual void | initializeStep () |
Initialize the mixture model before its use by the composer. | |
virtual Real | lnComponentProbability (int i, int k) |
This function must be defined to return the component probability distribution function (PDF) for corresponding sample i and cluster k. | |
virtual void | paramUpdateStep () |
This function is equivalent to Mstep and must be defined to update parameters. | |
virtual void | randomInit () |
This function should be used in order to initialize randomly the parameters of the mixture. | |
virtual int | nbFreeParameter () const |
This function must return the number of free parameters. | |
virtual int | nbMissingValues () const |
This function must return the number of missing value in data set identified by idData_. | |
virtual void | storeIntermediateResults (int iteration) |
This function should be used to store any intermediate results during various iterations after the burn-in period. | |
virtual void | releaseIntermediateResults () |
This step can be used to signal to the mixtures that they must release the stored results. | |
virtual void | setParametersStep () |
set the parameters of the model. | |
virtual void | finalizeStep () |
This step can be used by developer to finalize any thing. | |
virtual void | imputationStep () |
This function should be used for imputation of data. | |
virtual void | samplingStep () |
This function must be defined for simulation of all the latent variables and/or missing data excluding class labels. | |
virtual void | writeParameters (ostream &os) const |
This function can be used to write summary of parameters to the output stream. | |
![]() | |
IMixture (String const &idData=String()) | |
Constructor with identification character. | |
IMixture (IMixture const &mixture) | |
copy constructor. | |
virtual | ~IMixture () |
Virtual destructor. | |
String const & | idData () const |
IMixtureStatModel const *const | p_composer () const |
void | setMixtureModel (IMixtureStatModel const *p_composer) |
set the mixture composer to the mixture | |
virtual void | writeParameters (std::ostream &out) const |
This function can be used to write summary of parameters on to the output stream. | |
![]() | |
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. | |
Private Member Functions | |
HDGaussianBridge (Mixture const &mixture, String const &idData, int nbCluster) | |
protected constructor to use in order to create a bridge. | |
Additional Inherited Members | |
![]() | |
IMixtureBridge (Data *p_data, String const &idData, int nbCluster) | |
default constructor. | |
IMixtureBridge (IMixtureBridge const &bridge) | |
copy constructor | |
IMixtureBridge (Mixture const &mixture, String const &idData, int nbCluster) | |
protected constructor to use in order to create a bridge. | |
virtual | ~IMixtureBridge () |
destructor | |
virtual std::vector< std::pair< int, int > >::size_type | findMissing () |
utility function for lookup the data set and find missing values coordinates. | |
virtual void | removeMissing () |
This function will be used once for imputation of missing data at the initialization step (. | |
![]() | |
int | nbSample () const |
This function can be used in derived classes to get number of samples. | |
int | nbCluster () const |
This function can be used in derived classes to get number of classes. | |
CPointX const * | p_pk () const |
This function can be used in derived classes to get estimated number of individuals from the framework. | |
CPointX const * | p_tk () const |
This function can be used in derived classes to get proportions from the framework. | |
CArrayXX const * | p_tik () const |
This function can be used in derived classes to get posterior probabilities from the framework. | |
CVectorXi const * | p_zi () const |
This function can be used in derived classes to get class labels from the framework. | |
![]() | |
IRecursiveTemplate () | |
constructor. | |
~IRecursiveTemplate () | |
destructor. | |
![]() | |
Mixture | mixture_ |
The Mixture to bridge with the composer. | |
MissingIndexes | v_missing_ |
vector with the coordinates of the missing values | |
Data * | p_dataij_ |
pointer on the data set | |
template implementation of the IMixture interface allowing to bridge a STK++ mixture with the composer.
This class inherit from the interface IMixture and delegate almost all the treatments to the wrapped class. The bridge handles the missing values and the averaging of the parameters and imputed/simulated missing values during the estimation process.
Id | is any identifier of a concrete model deriving from the interface STK::IMixtureDensity class. This identifier should be find in the Clust::Mixture enum. |
Data | container of the data used by the STK::DataBridge class |
Definition at line 94 of file STK_HDGaussianBridge.h.
typedef IMixtureBridge< HDGaussianBridge<Id,Data> > STK::HDGaussianBridge< Id, Data >::Base |
Definition at line 98 of file STK_HDGaussianBridge.h.
typedef std::vector<std::pair<int,int>>::const_iterator STK::HDGaussianBridge< Id, Data >::ConstIterator |
Definition at line 109 of file STK_HDGaussianBridge.h.
typedef hidden::MixtureBridgeTraits<HDGaussianBridge<Id,Data>>::Mixture STK::HDGaussianBridge< Id, Data >::Mixture |
Definition at line 100 of file STK_HDGaussianBridge.h.
typedef hidden::MixtureBridgeTraits<HDGaussianBridge<Id,Data>>::Parameters STK::HDGaussianBridge< Id, Data >::Parameters |
Definition at line 101 of file STK_HDGaussianBridge.h.
typedef hidden::MixtureBridgeTraits<HDGaussianBridge<Id,Data>>::Type STK::HDGaussianBridge< Id, Data >::Type |
Definition at line 103 of file STK_HDGaussianBridge.h.
|
inline |
default constructor.
Remove the missing values from the data set and initialize the mixture by setting the data set.
p_dataij | pointer on the data set used by the bridge. |
idData | id name of the mixture model |
nbCluster | number of cluster |
Definition at line 122 of file STK_HDGaussianBridge.h.
References STK::IMixtureBridge< HDGaussianBridge< Id, Data > >::mixture_, and STK::IMixtureBridge< HDGaussianBridge< Id, Data > >::removeMissing().
|
inline |
|
inlinevirtual |
|
inlineprivate |
protected constructor to use in order to create a bridge.
mixture | the mixture to copy |
idData | id name of the mixture |
nbCluster | number of cluster |
Definition at line 164 of file STK_HDGaussianBridge.h.
|
inlinevirtual |
This is a standard clone function in usual sense.
It must be defined to provide new object of your class with values of various parameters equal to the values of calling object. In other words, this is equivalent to polymorphic copy constructor.
Implements STK::IMixture.
Definition at line 138 of file STK_HDGaussianBridge.h.
|
inlinevirtual |
This is a standard create function in usual sense.
It must be defined to provide new object of your class with correct dimensions and state. In other words, this is equivalent to virtual constructor.
Implements STK::IMixture.
Definition at line 144 of file STK_HDGaussianBridge.h.
References STK::IMixture::idData(), STK::IMixtureBridge< HDGaussianBridge< Id, Data > >::mixture_, STK::IMixture::nbCluster(), STK::IMixtureBridge< HDGaussianBridge< Id, Data > >::p_dataij_, STK::IRunnerSupervised< YArray_, XArray_, Weights_ >::setData(), and STK::IMixtureBridge< HDGaussianBridge< Id, Data > >::v_missing_.
|
inline |
j | index of the column with the safe value needed |
Definition at line 155 of file STK_HDGaussianBridge.h.