37#if STK_MIXTURE_DEBUG | STK_MIXTURE_VERBOSE | STK_MIXTURE_VERY_VERBOSE
51 , unknownLabels_(nbSample)
54 std::vector<int>::iterator
it;
63 , knownLabels_(
model.knownLabels_)
64 , unknownLabels_(
model.unknownLabels_)
86 std::vector<int>::const_iterator
it;
98 std::vector<int>::const_iterator
it;
107#ifdef STK_MIXTURE_DEBUG
108 stk_cout <<
_T(
"Entering MixtureSemiLearner::eStep()\n");
114 std::vector<int>::const_iterator
it;
123#ifdef STK_MIXTURE_DEBUG
124 stk_cout <<
_T(
"MixtureSemiLearner::eStep() done\n");
133 std::vector<int>::const_iterator
it;
142 std::vector<int>::const_iterator
it;
153 std::vector<int>::const_iterator
it;
170 std::vector<int>::const_iterator
it;
This file define methods for displaying Arrays and Expressions.
In this file we define the Categorical distribution.
In this file we define the MixtureSemiLearner class for semi-supervised learning models.
This file contain the functors computings statistics.
#define stk_cout
Standard stk output stream.
#define _T(x)
Let x unmodified.
Type const minElt(int &row, int &col) const
hidden::CSlice< Derived, 1, sizeCols_ >::Result row(int i) const
implement the row operator using a reference on the row of the allocator
virtual int cStep()
Replace tik by zik.
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.
virtual int sStep()
Simulate zi accordingly to tik and replace tik by zik by calling cStep().
CArrayXX tik_
The tik probabilities.
CVectorXi zi_
The zi class label.
std::vector< IMixture * > const & v_mixtures() const
CPointX pk_
The proportions of each mixtures.
CPointX tk_
The sum of the columns of tik_.
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
Categorical probability law.
Main class for handling composed mixture models.
void createComposer(std::vector< IMixture * > const &v_mixtures_)
Create the composer using existing data handler and mixtures.
virtual Real lnComponentProbability(int i, int k) const
specialization of the composer for the fixed proportion case.
virtual MixtureSemiLearnerFixedProp * create() const
Create a composer, but reinitialize the mixtures parameters.
MixtureSemiLearnerFixedProp(int nbSample, int nbCluster)
Constructor.
virtual void pStep()
overloading of the pStep() method.
virtual MixtureSemiLearnerFixedProp * clone() const
Create a clone of the current model, with mixtures parameters preserved.
Base class for Learning a Mixture mixed model when some classes are known.
virtual void mapStep()
Compute zi using the Map estimate.
virtual void initializeMixtureParameters()
Create the mixture model parameters tik_ and pk_.
virtual int randomZi()
generate random zi_
MixtureSemiLearner(int nbSample, int nbCluster)
Constructor.
virtual MixtureSemiLearner * create() const
Create a composer, but reinitialize the mixtures parameters.
virtual int randomTik()
generate random tik_
std::vector< int > unknownLabels_
indexes of the unknown labels
virtual ~MixtureSemiLearner()
destructor
void createSemiLearner(MixtureSemiLearner const *const p_learner)
Copy the ingredient of the semi-learner in the creation process.
virtual int sStep()
Simulate zi accordingly to tik and replace tik by zik by calling cStep().
virtual int cStep()
Replace tik by zik.
virtual Real eStep()
compute the zi, the lnLikelihood of the current estimates and the next value of the tik.
virtual MixtureSemiLearner * clone() const
Create a clone of the current model, with mixtures parameters preserved.
std::vector< int > knownLabels_
indexes of the known labels
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
double Real
STK fundamental type of Real values.
hidden::FunctorTraits< Derived, SumOp >::Row sum(Derived const &A)
Compute the sum of A.
hidden::FunctorTraits< Derived, SumOp >::Row sumByCol(Derived const &A)
The namespace STK is the main domain space of the Statistical ToolKit project.