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 ¶ms) 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 int > | m_classLabels |
| class labels More... | |
| bool | m_isInitialized |
| True if this instance is initialized. More... | |
| Parameters | m_parameters |
| Internal execution parameters. More... | |
| te::cl::MAP::MAP | ( | ) |
Definition at line 67 of file MAP.cpp.
References te::cl::MAP::Parameters::reset(), and ~MAP().
|
default |
Referenced by MAP().
| 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.
| input | Input data to be classified. |
| attributesIndices | The attributes indexes to processe from the iterated train data. |
| inputNoDataValues | A vector of no-data values for each attribute dimension or an empty vector if no-data values are not used. |
| output | Output classified data. |
| outputIndex | The output attribute index. |
| outputNoDataValue | A output label value to use when dealing with input no-data. |
| enableProgressInterface | Enable/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().
|
protected |
Calculate priori probabilities by pre-classifying the input data.
| input | Input data to be classified. |
| attributesIndices | The attributes indexes to processe from the iterated train data. |
| prioriProbs | Calculated 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.
| params | New 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().
|
protected |
Reset this instance to its initial state.
Definition at line 115 of file MAP.cpp.
References m_classesCovarianceInvMatrixes, m_classesCovarianceMatrixes, m_classesMeans, m_classesOptizedMAPDiscriminantTerm, m_classLabels, m_isInitialized, m_parameters, and te::cl::MAP::Parameters::reset().
| 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.
| samples | Train data samples. |
| attributesIndices | The attributes indexes to processe from the iterated train data. |
| sampleLabels | The sample lables for each iterated train data element. |
| enableProgressInterface | Enable/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().
|
protected |
Classes covariance inverse matrixes.
Definition at line 131 of file MAP.h.
Referenced by classify(), getPrioriProbabilities(), reset(), and train().
|
protected |
Classes covariance matrixes.
Definition at line 130 of file MAP.h.
Referenced by classify(), reset(), and train().
|
protected |
Classes means;.
Definition at line 129 of file MAP.h.
Referenced by classify(), getPrioriProbabilities(), reset(), and train().
|
protected |
An optimized portion of the MAP discriminant function.
Definition at line 133 of file MAP.h.
Referenced by classify(), getPrioriProbabilities(), reset(), and train().
|
protected |
|
protected |
True if this instance is initialized.
Definition at line 127 of file MAP.h.
Referenced by classify(), initialize(), reset(), and train().
|
protected |
Internal execution parameters.
Definition at line 128 of file MAP.h.
Referenced by classify(), getPrioriProbabilities(), initialize(), reset(), and train().