STK++ 0.9.13
STK_MixtureLearner.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------*/
2/* Copyright (C) 2004-2016 Serge Iovleff
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with this program; if not, write to the
16 Free Software Foundation, Inc.,
17 59 Temple Place,
18 Suite 330,
19 Boston, MA 02111-1307
20 USA
21
22 Contact : S..._Dot_I..._At_stkpp_Dot_org (see copyright for ...)
23*/
24
25/*
26 * Project: stkpp::Clustering
27 * created on: 14 nov. 2013
28 * Author: iovleff, S..._Dot_I..._At_stkpp_Dot_org (see copyright for ...)
29 * Originally created by Parmeet Bhatia <b..._DOT_p..._AT_gmail_Dot_com>
30 **/
31
36#ifndef STK_MIXTURELEARNER_H
37#define STK_MIXTURELEARNER_H
38
39#include <vector>
40#include <list>
41
42#include "STK_IMixtureLearner.h"
43
44namespace STK
45{
46class IMixture;
71{
72 public:
73 typedef std::vector<IMixture*>::const_iterator ConstMixtIterator;
74 typedef std::vector<IMixture*>::iterator MixtIterator;
84 virtual ~MixtureLearner();
85
87 virtual MixtureLearner* create() const;
89 virtual MixtureLearner* clone() const;
93 virtual Real lnComponentProbability(int i, int k) const;
95 virtual void writeParameters(ostream& os) const;
97 virtual void randomInit();
101 virtual void paramUpdateStep();
103 virtual void imputationStep();
106 virtual void samplingStep();
111 virtual void storeIntermediateResults(int iteration);
116 virtual void releaseIntermediateResults();
119 virtual void setParametersStep();
123 virtual void finalizeStep();
124
125 protected:
131 void createLearner( std::vector<IMixture*> const& v_mixtures_);
132
133 private:
138};
139
140} /* namespace STK */
141
142#endif /* STK_MIXTURELEARNER_H */
In this file we define the interface base class for learners.
Base class for Learner of a Mixture mixed model.
std::vector< IMixture * > v_mixtures_
vector of pointers to the mixtures components
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.
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...
double Real
STK fundamental type of Real values.
std::basic_ostream< Char > ostream
ostream for Char
Definition STK_Stream.h:57
The namespace STK is the main domain space of the Statistical ToolKit project.