48 , meanlnLikelihood_(0.)
56 , meanlnLikelihood_(
learner.meanlnLikelihood_)
77 {
sum += (*it)->lnComponentProbability(
i,k);}
84 { (*it)->paramUpdateStep();}
90 os <<
_T(
"Learner nbSample = ") <<
nbSample() << std::endl;
94 os <<
_T(
"Learner proportions = ") <<
pk();
98 os <<
_T(
"\nParameters of the mixture: ") << (*it)->idData() <<
_T(
"\n");
99 (*it)->writeParameters(
os);
105#ifdef STK_MIXTURE_VERBOSE
106 stk_cout <<
_T(
"Entering MixtureLearner::RandomInit()\n");
110 { (*it)->randomInit();}
112#ifdef STK_MIXTURE_VERBOSE
113 stk_cout <<
_T(
"MixtureLearner::RandomInit() done\n");
121 { (*it)->imputationStep();}
130 { (*it)->samplingStep();}
137 { (*it)->storeIntermediateResults(
iteration);}
144 { (*it)->releaseIntermediateResults();}
152 { (*it)->setParametersStep();}
This file define methods for displaying Arrays and Expressions.
In this file we define the class MixtureLearner.
#define stk_cout
Standard stk output stream.
#define _T(x)
Let x unmodified.
Base class for Learner of a Mixture mixed model.
void setState(Clust::modelState state)
set the state of the model : should be used by any strategy
Clust::modelState state() const
CPointX const & pk() const
Real computeLnLikelihood() const
virtual void initializeStep()
Initialize the model before at its first use.
std::vector< IMixture * > const & v_mixtures() const
int computeNbFreeParameters() const
compute the number of free parameters of the model.
std::vector< IMixture * > v_mixtures_
vector of pointers to the mixtures components
virtual bool finalizeStep()
perform any computation needed after the call of the regression method.
virtual bool initializeStep()
perform any computation needed before the call of the regression method.
int nbFreeParameter() const
void setNbFreeParameter(int const &nbFreeParameter)
set the number of free parameters 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
Real lnLikelihood() const
Main class for learning mixture models.
void createLearner(std::vector< IMixture * > const &v_mixtures_)
Create the composer using existing data handler and mixtures.
virtual MixtureLearner * create() const
Create a composer, but reinitialize the mixtures parameters.
virtual void randomInit()
initialize randomly the parameters of the components of the model
virtual void writeParameters(ostream &os) const
write the parameters of the model in the stream os.
virtual void paramUpdateStep()
Compute the model parameters given the current imputed/simulated missing values.
virtual void samplingStep()
Simulation of all the data missing values.
std::vector< IMixture * >::const_iterator ConstMixtIterator
virtual void setParametersStep()
Utility method allowing to signal to a mixture to set its parameters.
MixtureLearner(int nbSample, int nbCluster)
Constructor.
Real meanlnLikelihood_
averaged lnLikelihood values.
virtual ~MixtureLearner()
The registered mixtures will be deleted there.
virtual void releaseIntermediateResults()
This step can be used to signal to the mixtures that they must release the stored results.
virtual void imputationStep()
Impute the data missing values.
virtual MixtureLearner * clone() const
Create a clone of the current model, with mixtures parameters preserved.
virtual Real lnComponentProbability(int i, int k) const
virtual void finalizeStep()
This step can be used by developer to finalize any thing.
std::vector< IMixture * >::iterator MixtIterator
virtual void storeIntermediateResults(int iteration)
This step can be used to signal to the mixtures that they must store results.
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
Arrays::SumOp< Lhs, Rhs >::result_type sum(Lhs const &lhs, Rhs const &rhs)
convenience function for summing two arrays
@ modelParamInitialized_
The parameters of the model have been initialized.
double Real
STK fundamental type of Real values.
The namespace STK is the main domain space of the Statistical ToolKit project.