STK++ 0.9.13
|
Base class for Learner of a Mixture mixed model. More...
#include <STK_IMixtureLearner.h>
Public Member Functions | |
virtual | ~IMixtureLearner () |
destructor | |
CVectorXi const & | ziPred () const |
Clust::modelState | state () const |
void | setState (Clust::modelState state) |
set the state of the model : should be used by any strategy | |
virtual void | mapStep () |
Compute ziPred using the Map estimate. | |
virtual void | paramUpdateStep ()=0 |
Compute the model parameters given the current mixture parameters and imputation/simulation of the missing values. | |
template<class ColVector > | |
void | setClassLabels (ColVector const &zi) |
set the mixture parameters using the given class labels. | |
template<class ColVector , class RowVector > | |
void | setClassLabels (ColVector const &zi, RowVector const &pk) |
set the mixture parameters using the class labels and giving the proportions. | |
![]() | |
virtual | ~IMixtureStatModel () |
destructor | |
int | nbCluster () const |
CPointX const & | pk () const |
CArrayXX const & | tik () const |
CPointX const & | tk () const |
CVectorXi const & | zi () const |
std::vector< IMixture * > const & | v_mixtures () const |
Real | computeLnLikelihood (int i) const |
Real | computeLikelihood (int i) const |
Real | computeLnLikelihood () const |
Real | computeICL () const |
IMixture * | getMixture (String const &idData) const |
Utility lookup function allowing to find a Mixture from its idData. | |
void | registerMixture (IMixture *p_mixture) |
register a mixture to the composer. | |
void | releaseMixture (String const &idData) |
release a mixture from the composer. | |
int | computeNbFreeParameters () const |
compute the number of free parameters of the model. | |
int | computeNbMissingValues () const |
compute the missing values of the model. | |
virtual IMixtureStatModel * | create () const =0 |
create pattern | |
virtual IMixtureStatModel * | clone () const =0 |
clone pattern | |
virtual void | randomInit ()=0 |
initialize randomly the parameters of the components of the model | |
virtual Real | lnComponentProbability (int i, int k) const =0 |
virtual void | initializeStep () |
Initialize the model before at its first use. | |
virtual void | imputationStep () |
Impute the missing values. | |
virtual void | samplingStep () |
Simulation of all the latent variables and/or missing data excluding class labels. | |
virtual void | setParametersStep () |
Utility method allowing to signal to a mixture to set its parameters. | |
virtual void | storeIntermediateResults (int iteration) |
This step can be used to signal to the mixtures that they must store results. | |
virtual void | releaseIntermediateResults () |
This step can be used to signal to the mixtures that they must release the stored results. | |
virtual void | finalizeStep () |
Finalize the estimation of the model. | |
virtual void | writeParameters (ostream &os) const |
write the parameters of the model in the stream os. | |
template<class Array > | |
void | setMixtureParameters (Array const &tik) |
set the mixture parameters using an array of posterior probabilities. | |
template<class Array , class RowVector > | |
void | setMixtureParameters (Array const &tik, RowVector const &pk) |
set the mixture parameters giving the posterior probabilities and the proportions. | |
template<class RowVector > | |
void | setProportions (RowVector const &pk) |
Set proportions of each classes. | |
template<class Manager , class Parameters > | |
void | setParameters (IMixtureManager< Manager > const &manager, String const &idData, Parameters const ¶m) |
Utility method allowing to set the parameters to a specific mixture. | |
template<class Manager > | |
void | createMixture (IMixtureManager< Manager > &manager) |
Utility method allowing to create all the mixtures registered in the data handler of a mixture manager and to register them. | |
template<class Manager > | |
IMixture * | createMixture (IMixtureManager< Manager > &manager, String const &idData) |
Utility method allowing to create a mixture with a given data set and register it. | |
template<class Manager > | |
void | removeMixture (IMixtureManager< Manager > &manager, String const &idData) |
Utility method allowing to release completely a mixture with its data set. | |
template<class Manager , class Parameters > | |
void | getParameters (IMixtureManager< Manager > const &manager, String const &idData, Parameters ¶m) const |
Utility method allowing to get the parameters of a specific mixture. | |
template<class Manager , class MissingValues > | |
void | getMissingValues (IMixtureManager< Manager > const &manager, String const &idData, MissingValues &missing) const |
Utility method allowing to get the missing values of a specific mixture. | |
template<class DataHandler > | |
void | createMixture (IMixtureManager< DataHandler > &manager) |
![]() | |
int | nbSample () const |
Real | lnNbSample () const |
int | nbVariable () const |
Real | lnLikelihood () const |
Real | likelihood () const |
int | nbFreeParameter () const |
Real | computeBIC () const |
Real | computeAIC () const |
Real | computeML () const |
Protected Member Functions | |
IMixtureLearner (int nbSample, int nbCluster) | |
Constructor. | |
IMixtureLearner (IMixtureLearner const &model) | |
copy constructor. | |
![]() | |
IMixtureStatModel (int nbSample, int nbCluster) | |
Constructor. | |
IMixtureStatModel (IMixtureStatModel const &model) | |
copy constructor. | |
void | setNbCluster (int nbCluster) |
set the number of cluster of the model | |
![]() | |
IStatModelBase () | |
Default constructor. | |
IStatModelBase (int nbSample) | |
Constructor with specified dimension. | |
IStatModelBase (int nbSample, int nbVariable) | |
Constructor with specified dimension. | |
IStatModelBase (IStatModelBase const &model) | |
Copy constructor. | |
~IStatModelBase () | |
destructor | |
void | setNbFreeParameter (int const &nbFreeParameter) |
set the number of free parameters of the model | |
void | setNbSample (int const &nbSample) |
set the number of samples of the model | |
void | setNbVariable (int const &nbVariable) |
set the number of variables of the model | |
void | setLnLikelihood (Real const &lnLikelihood) |
set the log-likelihood of the model | |
void | initialize (int nbSample, int nbVariable) |
set the dimensions of the parameters of the model | |
Private Attributes | |
CVectorXi | ziPred_ |
The predicted class label. | |
Clust::modelState | state_ |
state of the model | |
Additional Inherited Members | |
![]() | |
typedef std::vector< IMixture * >::const_iterator | ConstMixtIterator |
typedef std::vector< IMixture * >::iterator | MixtIterator |
![]() | |
int | nbCluster_ |
number of cluster. | |
CPointX | pk_ |
The proportions of each mixtures. | |
CArrayXX | tik_ |
The tik probabilities. | |
CPointX | tk_ |
The sum of the columns of tik_. | |
CVectorXi | zi_ |
The zi class label. | |
std::vector< IMixture * > | v_mixtures_ |
vector of pointers to the mixtures components | |
Base class for Learner of a Mixture mixed model.
In this interface we assume there is an underline generative model that will be estimated using a MCMC algorithm.
The pure virtual function to implement in derived class are
Definition at line 56 of file STK_IMixtureLearner.h.
Constructor.
nbCluster,nbSample | number of clusters and samples |
Definition at line 43 of file STK_IMixtureLearner.cpp.
|
protected |
copy constructor.
model | the model to clone |
Definition at line 51 of file STK_IMixtureLearner.cpp.
|
virtual |
|
virtual |
Compute ziPred using the Map estimate.
Definition at line 58 of file STK_IMixtureLearner.cpp.
References STK::ExprBase< Derived >::isInfinite(), STK::IMixtureStatModel::lnComponentProbability(), STK::Clust::mapStepFail_, STK::max(), STK::ExprBase< Derived >::maxElt(), STK::IMixtureStatModel::pk_, STK::ICArray< Derived >::row(), STK::sum(), STK::IMixtureStatModel::tik_, and ziPred_.
Referenced by STK::ImputeAlgo::run(), and STK::SimulAlgo::run().
Compute the model parameters given the current mixture parameters and imputation/simulation of the missing values.
Implemented in STK::MixtureLearner.
Referenced by STK::ImputeAlgo::run(), and STK::SimulAlgo::run().
set the mixture parameters using the given class labels.
Posterior probabilities, numbers in each class and proportions are computed using the class labels.
zi | class labels |
Definition at line 113 of file STK_IMixtureLearner.h.
References STK::IStatModelBase::nbSample(), STK::IMixtureStatModel::pk_, STK::Stat::sumByCol(), STK::IMixtureStatModel::tik_, STK::IMixtureStatModel::tk_, STK::IMixtureStatModel::zi(), and STK::IMixtureStatModel::zi_.
set the mixture parameters using the class labels and giving the proportions.
zi | class labels |
pk | proportions of each class |
Definition at line 129 of file STK_IMixtureLearner.h.
References STK::IMixtureStatModel::pk(), STK::IMixtureStatModel::pk_, STK::Stat::sumByCol(), STK::IMixtureStatModel::tik_, STK::IMixtureStatModel::tk_, STK::IMixtureStatModel::zi(), and STK::IMixtureStatModel::zi_.
|
inline |
set the state of the model : should be used by any strategy
Definition at line 77 of file STK_IMixtureLearner.h.
References state(), and state_.
Referenced by STK::MixtureLearner::randomInit().
|
inline |
Definition at line 75 of file STK_IMixtureLearner.h.
References state_.
Referenced by STK::MixtureLearner::randomInit(), and setState().
Definition at line 73 of file STK_IMixtureLearner.h.
References ziPred_.
|
private |
state of the model
Definition at line 105 of file STK_IMixtureLearner.h.
Referenced by setState(), and state().
|
private |
The predicted class label.
Definition at line 103 of file STK_IMixtureLearner.h.