STK++ 0.9.13
STK::MixtureSemiLearnerFixedProp Class Reference

specialization of the composer for the fixed proportion case. More...

#include <STK_MixtureSemiLearner.h>

Inheritance diagram for STK::MixtureSemiLearnerFixedProp:
Inheritance graph

Public Member Functions

 MixtureSemiLearnerFixedProp (int nbSample, int nbCluster)
 Constructor.
 
 MixtureSemiLearnerFixedProp (MixtureSemiLearnerFixedProp const &model)
 copy constructor.
 
virtual ~MixtureSemiLearnerFixedProp ()
 destructor
 
virtual MixtureSemiLearnerFixedPropcreate () const
 Create a composer, but reinitialize the mixtures parameters.
 
virtual MixtureSemiLearnerFixedPropclone () const
 Create a clone of the current model, with mixtures parameters preserved.
 
virtual void pStep ()
 overloading of the pStep() method.
 
- Public Member Functions inherited from STK::MixtureSemiLearner
 MixtureSemiLearner (int nbSample, int nbCluster)
 Constructor.
 
 MixtureSemiLearner (MixtureSemiLearner const &model)
 copy constructor.
 
virtual ~MixtureSemiLearner ()
 destructor
 
std::vector< int > constknownLabels () const
 
std::vector< int > constunknownLabels () const
 
virtual int cStep ()
 Replace tik by zik.
 
virtual int sStep ()
 Simulate zi accordingly to tik and replace tik by zik by calling cStep().
 
virtual Real eStep ()
 compute the zi, the lnLikelihood of the current estimates and the next value of the tik.
 
virtual void mapStep ()
 Compute zi using the Map estimate.
 
template<class RowVector >
void setLabels (ExprBase< RowVector > const &zi)
 Set the known labels.
 
- Public Member Functions inherited from STK::MixtureComposer
 MixtureComposer (int nbSample, int nbCluster)
 Constructor.
 
 MixtureComposer (MixtureComposer const &composer)
 copy constructor.
 
virtual ~MixtureComposer ()
 The registered mixtures will be deleted there.
 
virtual Real lnComponentProbability (int i, int k) const
 
virtual void writeParameters (ostream &os) const
 write the parameters of the model in the stream os.
 
virtual void randomInit ()
 initialize randomly the parameters of the components of the model
 
virtual void paramUpdateStep ()
 Compute the proportions and the model parameters given the current tik mixture parameters.
 
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 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 setParametersStep ()
 Utility method allowing to signal to a mixture to set its parameters.
 
virtual void finalizeStep ()
 This step can be used by developer to finalize any thing.
 
- Public Member Functions inherited from STK::IMixtureComposer
virtual ~IMixtureComposer ()
 destructor
 
Clust::modelState state () const
 
void setState (Clust::modelState state)
 set the state of the model : should be used by any strategy
 
virtual void initializeStep ()
 Initialize the model before its first use.
 
void randomClassInit ()
 Initialize randomly the labels zi of the model.
 
void randomFuzzyInit ()
 Initialize randomly the posterior probabilities tik of the model, then compute the zi values with mapStep, compute the initial parameter values using paramUpdateStep, and compute the tik using eStep().
 
- Public Member Functions inherited from STK::IMixtureStatModel
virtual ~IMixtureStatModel ()
 destructor
 
int nbCluster () const
 
CPointX constpk () const
 
CArrayXX consttik () const
 
CPointX consttk () const
 
CVectorXi constzi () const
 
std::vector< IMixture * > constv_mixtures () const
 
Real computeLnLikelihood (int i) const
 
Real computeLikelihood (int i) const
 
Real computeLnLikelihood () const
 
Real computeICL () const
 
IMixturegetMixture (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.
 
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 &param)
 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 >
IMixturecreateMixture (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 &param) 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)
 
- Public Member Functions inherited from STK::IStatModelBase
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
 

Additional Inherited Members

- Public Types inherited from STK::MixtureComposer
typedef std::vector< IMixture * >::const_iterator ConstMixtIterator
 
typedef std::vector< IMixture * >::iterator MixtIterator
 
- Public Types inherited from STK::IMixtureStatModel
typedef std::vector< IMixture * >::const_iterator ConstMixtIterator
 
typedef std::vector< IMixture * >::iterator MixtIterator
 
- Protected Member Functions inherited from STK::MixtureSemiLearner
virtual void initializeMixtureParameters ()
 Create the mixture model parameters tik_ and pk_.
 
virtual int randomTik ()
 generate random tik_
 
virtual int randomZi ()
 generate random zi_
 
void createSemiLearner (MixtureSemiLearner const *const p_learner)
 Copy the ingredient of the semi-learner in the creation process.
 
- Protected Member Functions inherited from STK::MixtureComposer
void createComposer (std::vector< IMixture * > const &v_mixtures_)
 Create the composer using existing data handler and mixtures.
 
- Protected Member Functions inherited from STK::IMixtureComposer
 IMixtureComposer (int nbSample, int nbCluster)
 Constructor.
 
 IMixtureComposer (IMixtureComposer const &model)
 copy constructor.
 
void sStep (int i)
 Simulate zi accordingly to tik.
 
void cStep (int i)
 Replace tik by zik.
 
Real eStep (int i)
 compute one zi and the next value of the tik for i fixed
 
void mapStep (int i)
 Compute zi using the Map estimate for i fixed.
 
- Protected Member Functions inherited from STK::IMixtureStatModel
 IMixtureStatModel (int nbSample, int nbCluster)
 Constructor.
 
 IMixtureStatModel (IMixtureStatModel const &model)
 copy constructor.
 
void setNbCluster (int nbCluster)
 set the number of cluster of the model
 
- Protected Member Functions inherited from STK::IStatModelBase
 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
 
- Protected Attributes inherited from STK::MixtureSemiLearner
std::vector< intknownLabels_
 indexes of the known labels
 
std::vector< intunknownLabels_
 indexes of the unknown labels
 
- Protected Attributes inherited from STK::MixtureComposer
Real meanlnLikelihood_
 averaged lnLikelihood values.
 
- Protected Attributes inherited from STK::IMixtureStatModel
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
 

Detailed Description

specialization of the composer for the fixed proportion case.

Definition at line 148 of file STK_MixtureSemiLearner.h.

Constructor & Destructor Documentation

◆ MixtureSemiLearnerFixedProp() [1/2]

STK::MixtureSemiLearnerFixedProp::MixtureSemiLearnerFixedProp ( int  nbSample,
int  nbCluster 
)

Constructor.

Parameters
nbCluster,nbSamplenumber of clusters and samples

Definition at line 187 of file STK_MixtureSemiLearner.cpp.

189{ setNbFreeParameter(0); /* remove the count of the pk parameters */}
void setNbFreeParameter(int const &nbFreeParameter)
set the number of free parameters of the model
MixtureSemiLearner(int nbSample, int nbCluster)
Constructor.

References STK::IStatModelBase::setNbFreeParameter().

◆ MixtureSemiLearnerFixedProp() [2/2]

STK::MixtureSemiLearnerFixedProp::MixtureSemiLearnerFixedProp ( MixtureSemiLearnerFixedProp const model)

copy constructor.

Parameters
modelthe model to copy

Definition at line 194 of file STK_MixtureSemiLearner.cpp.

195 : MixtureSemiLearner(model) {}

◆ ~MixtureSemiLearnerFixedProp()

virtual STK::MixtureSemiLearnerFixedProp::~MixtureSemiLearnerFixedProp ( )
inlinevirtual

destructor

Definition at line 160 of file STK_MixtureSemiLearner.h.

160{}

Member Function Documentation

◆ clone()

MixtureSemiLearnerFixedProp * STK::MixtureSemiLearnerFixedProp::clone ( ) const
virtual

Create a clone of the current model, with mixtures parameters preserved.

Reimplemented from STK::MixtureSemiLearner.

Definition at line 208 of file STK_MixtureSemiLearner.cpp.

209{ return new MixtureSemiLearnerFixedProp(*this);}
MixtureSemiLearnerFixedProp(int nbSample, int nbCluster)
Constructor.

◆ create()

MixtureSemiLearnerFixedProp * STK::MixtureSemiLearnerFixedProp::create ( ) const
virtual

Create a composer, but reinitialize the mixtures parameters.

Reimplemented from STK::MixtureSemiLearner.

Definition at line 198 of file STK_MixtureSemiLearner.cpp.

199{
201 p_composer->createSemiLearner(this);
202 p_composer->createComposer(v_mixtures());
203 /* remove the count of the pk parameters */
204 p_composer->setNbFreeParameter(p_composer->nbFreeParameter()-(nbCluster()-1));
205 return p_composer;
206}
std::vector< IMixture * > const & v_mixtures() const

References STK::MixtureComposer::createComposer(), STK::MixtureSemiLearner::createSemiLearner(), STK::IMixtureStatModel::nbCluster(), STK::IStatModelBase::nbFreeParameter(), STK::IStatModelBase::nbSample(), STK::IStatModelBase::setNbFreeParameter(), and STK::IMixtureStatModel::v_mixtures().

◆ pStep()

void STK::MixtureSemiLearnerFixedProp::pStep ( )
virtual

overloading of the pStep() method.

Let them initialized to 1/K.

Reimplemented from STK::IMixtureComposer.

Definition at line 212 of file STK_MixtureSemiLearner.cpp.

212{}

The documentation for this class was generated from the following files: