te::cl::MAP Class Reference

MAP strategy for classification. More...

#include <MAP.h>

Classes

class  Parameters
 Classifier Parameters. More...
 

Public Member Functions

bool classify (const InputAdaptor< double > &input, const std::vector< unsigned int > &attributesIndices, const std::vector< double > &inputNoDataValues, OutputAdaptor< unsigned int > &output, const unsigned int outputIndex, const double outputNoDataValue, const bool enableProgressInterface) throw (te::cl::Exception)
 Classify an input iterated data and save the result on the output iterated data. More...
 
bool initialize (const Parameters &params) throw (te::cl::Exception)
 Initialize this classifier instance with new parameters. More...
 
 MAP ()
 
bool train (const InputAdaptor< double > &samples, const std::vector< unsigned int > &attributesIndices, const std::vector< unsigned int > &sampleLabels, const bool enableProgressInterface) throw (te::cl::Exception)
 Train this classifier instance using the initialization parameters and the suppied train data. More...
 
 ~MAP ()
 

Protected Member Functions

bool getPrioriProbabilities (const InputAdaptor< double > &input, const std::vector< unsigned int > &attributesIndices, std::vector< double > &prioriProbs) const
 Calculate priori probabilities by pre-classifying the input data. More...
 
void reset ()
 Reset this instance to its initial state. More...
 

Protected Attributes

std::vector< boost::numeric::ublas::matrix< double > > m_classesCovarianceInvMatrixes
 Classes covariance inverse matrixes. More...
 
std::vector< boost::numeric::ublas::matrix< double > > m_classesCovarianceMatrixes
 Classes covariance matrixes. More...
 
std::vector< std::vector< double > > m_classesMeans
 Classes means;. More...
 
std::vector< double > m_classesOptizedMAPDiscriminantTerm
 An optimized portion of the MAP discriminant function. More...
 
std::vector< unsigned intm_classLabels
 class labels More...
 
bool m_isInitialized
 True if this instance is initialized. More...
 
Parameters m_parameters
 Internal execution parameters. More...
 

Detailed Description

MAP strategy for classification.

Definition at line 54 of file MAP.h.

Constructor & Destructor Documentation

te::cl::MAP::MAP ( )

Definition at line 67 of file MAP.cpp.

References te::cl::MAP::Parameters::reset(), and ~MAP().

te::cl::MAP::~MAP ( )
default

Referenced by MAP().

Member Function Documentation

bool te::cl::MAP::classify ( const InputAdaptor< double > &  input,
const std::vector< unsigned int > &  attributesIndices,
const std::vector< double > &  inputNoDataValues,
OutputAdaptor< unsigned int > &  output,
const unsigned int  outputIndex,
const double  outputNoDataValue,
const bool  enableProgressInterface 
)
throw (te::cl::Exception
)

Classify an input iterated data and save the result on the output iterated data.

Parameters
inputInput data to be classified.
attributesIndicesThe attributes indexes to processe from the iterated train data.
inputNoDataValuesA vector of no-data values for each attribute dimension or an empty vector if no-data values are not used.
outputOutput classified data.
outputIndexThe output attribute index.
outputNoDataValueA output label value to use when dealing with input no-data.
enableProgressInterfaceEnable/disable the use of a proress interfece.

Definition at line 346 of file MAP.cpp.

References te::cl::InputAdaptor< DataType >::getElementsCount(), te::cl::OutputAdaptor< DataType >::getElementsCount(), te::cl::InputAdaptor< DataType >::getFeature(), te::cl::InputAdaptor< DataType >::getFeaturesCount(), te::cl::OutputAdaptor< DataType >::getFeaturesCount(), getPrioriProbabilities(), m_classesCovarianceInvMatrixes, m_classesCovarianceMatrixes, m_classesMeans, m_classesOptizedMAPDiscriminantTerm, m_classLabels, m_isInitialized, m_parameters, te::cl::MAP::Parameters::m_prioriProbs, and te::cl::OutputAdaptor< DataType >::setFeature().

Referenced by BOOST_AUTO_TEST_SUITE(), and te::rp::ClassifierMAPStrategy::execute().

bool te::cl::MAP::getPrioriProbabilities ( const InputAdaptor< double > &  input,
const std::vector< unsigned int > &  attributesIndices,
std::vector< double > &  prioriProbs 
) const
protected

Calculate priori probabilities by pre-classifying the input data.

Parameters
inputInput data to be classified.
attributesIndicesThe attributes indexes to processe from the iterated train data.
prioriProbsCalculated priori-probabilities.

Definition at line 477 of file MAP.cpp.

References te::cl::InputAdaptor< DataType >::getElementsCount(), te::cl::InputAdaptor< DataType >::getFeature(), te::cl::InputAdaptor< DataType >::getFeaturesCount(), m_classesCovarianceInvMatrixes, m_classesMeans, m_classesOptizedMAPDiscriminantTerm, m_parameters, and te::cl::MAP::Parameters::m_prioriCalcSampleStep.

Referenced by classify().

bool te::cl::MAP::initialize ( const Parameters params)
throw (te::cl::Exception
)

Initialize this classifier instance with new parameters.

Parameters
paramsNew initialization parameters.

Definition at line 74 of file MAP.cpp.

References m_isInitialized, m_parameters, and te::cl::MAP::Parameters::reset().

Referenced by BOOST_AUTO_TEST_SUITE(), and te::rp::ClassifierMAPStrategy::initialize().

void te::cl::MAP::reset ( )
protected
bool te::cl::MAP::train ( const InputAdaptor< double > &  samples,
const std::vector< unsigned int > &  attributesIndices,
const std::vector< unsigned int > &  sampleLabels,
const bool  enableProgressInterface 
)
throw (te::cl::Exception
)

Train this classifier instance using the initialization parameters and the suppied train data.

Parameters
samplesTrain data samples.
attributesIndicesThe attributes indexes to processe from the iterated train data.
sampleLabelsThe sample lables for each iterated train data element.
enableProgressInterfaceEnable/disable the use of a proress interfece.

Definition at line 126 of file MAP.cpp.

References te::common::GetDeterminant(), te::common::GetInverseMatrix(), m_classesCovarianceInvMatrixes, m_classesCovarianceMatrixes, m_classesMeans, m_classesOptizedMAPDiscriminantTerm, m_classLabels, m_isInitialized, m_parameters, and te::cl::MAP::Parameters::m_prioriProbs.

Referenced by BOOST_AUTO_TEST_SUITE(), and te::rp::ClassifierMAPStrategy::initialize().

Member Data Documentation

std::vector< boost::numeric::ublas::matrix< double > > te::cl::MAP::m_classesCovarianceInvMatrixes
protected

Classes covariance inverse matrixes.

Definition at line 131 of file MAP.h.

Referenced by classify(), getPrioriProbabilities(), reset(), and train().

std::vector< boost::numeric::ublas::matrix< double > > te::cl::MAP::m_classesCovarianceMatrixes
protected

Classes covariance matrixes.

Definition at line 130 of file MAP.h.

Referenced by classify(), reset(), and train().

std::vector< std::vector< double > > te::cl::MAP::m_classesMeans
protected

Classes means;.

Definition at line 129 of file MAP.h.

Referenced by classify(), getPrioriProbabilities(), reset(), and train().

std::vector< double > te::cl::MAP::m_classesOptizedMAPDiscriminantTerm
protected

An optimized portion of the MAP discriminant function.

Definition at line 133 of file MAP.h.

Referenced by classify(), getPrioriProbabilities(), reset(), and train().

std::vector<unsigned int> te::cl::MAP::m_classLabels
protected

class labels

Definition at line 132 of file MAP.h.

Referenced by classify(), reset(), and train().

bool te::cl::MAP::m_isInitialized
protected

True if this instance is initialized.

Definition at line 127 of file MAP.h.

Referenced by classify(), initialize(), reset(), and train().

Parameters te::cl::MAP::m_parameters
protected

Internal execution parameters.

Definition at line 128 of file MAP.h.

Referenced by classify(), getPrioriProbabilities(), initialize(), reset(), and train().


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