Page MenuHomec4science

ReferenceComputer.hpp
No OneTemporary

File Metadata

Created
Fri, May 10, 21:21

ReferenceComputer.hpp

#ifndef REFERENCECOMPUTER_HPP
#define REFERENCECOMPUTER_HPP
#include <EMEngine.hpp>
#include <Matrix2D.hpp>
#include <Matrix4D.hpp>
/*!
* \brief The ReferenceComputer class is a wrapper around the
* EMEngine class that allows to compute the class references
* given the posterior probability matrix and the data without
* having to re-run the data classification.
*
* This class is typically made to be used in conjunction with
* an EMEngine instance, using the following pattern :
*
* Matrix2D<int> data = ... ;
* EMEngine em(data, ...) ;
* em.cluster() ;
* auto prob = em.get_posterior_prob() ;
* auto obj = ReferenceComputer(data, prob, ...) ;
* auto ll = obj.get_loglikelihood() ;
* auto ref = obj.get_references() ;
*/
class ReferenceComputer : public EMEngine
{
public:
ReferenceComputer() = delete ;
/*!
* \brief Constructs an obect and computes the references.
* \param the data for which the classification probabilities
* have been generated.
* \param the classification probabilities for the given data, as
* return by an EMEngine instance (see above).
* \param n_threads the number of threads dedicated to the
* computations.
*/
ReferenceComputer(const Matrix2D<int>& data,
const Matrix4D<double>& posterior_prob,
size_t n_threads) ;
/*!
* \brief Destructor.
*/
virtual ~ReferenceComputer() override ;
/*!
* \brief Returns a matrix with the class class references
* (protypic signal), on each row.
* The 1st column contains the class probability, the
* following ones the class signal.
* \return a matrix containing the class references and their
* probabalities, on each row.
*/
virtual Matrix2D<double> get_references() const override ;
// removes the following methods from the public interface to restrict it
private:
using EMEngine::cluster ;
} ;
#endif // REFERENCECOMPUTER_HPP

Event Timeline