libcrn
3.9.5
A document image processing library
|
Basic classification tools. More...
#include <CRNBasicClassify.h>
Static Public Member Functions | |
template<typename ConstIterator , typename std::enable_if< IsMetric< typename std::iterator_traits< ConstIterator >::value_type >::value, int >::type = 0> | |
static ClassifResult | NearestNeighbor (const typename std::iterator_traits< ConstIterator >::value_type &obj, ConstIterator begin, ConstIterator end) |
Finds the nearest neighbor in a set of objects. More... | |
template<typename T , typename std::enable_if< IsMetric< T >::value, int >::type = 0> | |
static ClassifResult | kNearestNeighbors (const T &obj, const Map &database, int k) |
Classify a sample using the k nearest neighbors. More... | |
template<typename T , typename std::enable_if< IsMetric< T >::value, int >::type = 0> | |
static ClassifResult | EpsilonNeighbors (const T &obj, const Map &database, double epsilon) |
Classify a sample using the k nearest neighbors. More... | |
Basic classification tools.
Basic classifications tools
Definition at line 47 of file CRNBasicClassify.h.
|
inlinestatic |
Classify a sample using the k nearest neighbors.
Classify a sample using the k nearest neighbors
std::bad_cast | the map does not contain objects of the same type as obj |
ExceptionRuntime | the sample is not of the same class as the model |
[in] | obj | the sample to classify |
[in] | database | a map with key=label value=SVector of samples |
[in] | epsilon | the maximal distance |
Definition at line 156 of file CRNBasicClassify.h.
|
inlinestatic |
Classify a sample using the k nearest neighbors.
Classify a sample using the k nearest neighbors
std::bad_cast | the map does not contain objects of the same type as obj |
ExceptionRuntime | the sample is not of the same class as the model |
[in] | obj | the sample to classify |
[in] | database | a map with key=label value=SVector of samples |
[in] | k | the number of nearest neighbors to taken into account |
Definition at line 103 of file CRNBasicClassify.h.
|
inlinestatic |
Finds the nearest neighbor in a set of objects.
Finds the nearest neighbor in a set of objects
ExceptionProtocol | the sample is not metric |
ExceptionRuntime | the sample is not of the same class as the model |
[in] | obj | the sample to classify |
[in] | begin | an input iterator to a pointer to the first prototype |
[in] | end | an input iterator after the last prototype |
Definition at line 66 of file CRNBasicClassify.h.