class AttenuatedEuclidianDistance
The adaptation of the familiar Euclidean Distance, to be used in ternary ECOC designs. This adaptation computes the Euclidean distance between two vectors ignoring those positions of either of the vectors valued as 0. Note that this might make sense only in the Decoding step of the ECOC framework, since the 0 value denotes that a certain category is ignored.
This distance was proposed by S. Escalera, O. Pujol, P.Radeva in On the decoding process in ternary error-correcting output codes, Transactions in Pattern Analysis and Machine Intelligence 99 (1).
Definition at line 38 of file AttenuatedEuclidianDistance.h.
Public Member Functions | |
CAttenuatedEuclidianDistance () | |
CAttenuatedEuclidianDistance (CSimpleFeatures< float64_t > *l, CSimpleFeatures< float64_t > *r) | |
virtual | ~CAttenuatedEuclidianDistance () |
virtual bool | init (CFeatures *l, CFeatures *r) |
virtual void | cleanup () |
virtual EDistanceType | get_distance_type () |
virtual EFeatureType | get_feature_type () |
virtual const char * | get_name () const |
virtual bool | get_disable_sqrt () |
virtual void | set_disable_sqrt (bool state) |
Protected Member Functions | |
virtual float64_t | compute (int32_t idx_a, int32_t idx_b) |
Protected Attributes | |
bool | disable_sqrt |
default constructor
Definition at line 19 of file AttenuatedEuclidianDistance.cpp.
CAttenuatedEuclidianDistance | ( | CSimpleFeatures< float64_t > * | l, | |
CSimpleFeatures< float64_t > * | r | |||
) |
constructor
l | features of left-hand side | |
r | features of right-hand side |
Definition at line 24 of file AttenuatedEuclidianDistance.cpp.
~CAttenuatedEuclidianDistance | ( | ) | [virtual] |
Definition at line 31 of file AttenuatedEuclidianDistance.cpp.
void cleanup | ( | ) | [virtual] |
cleanup distance
Implements CRealDistance.
Definition at line 42 of file AttenuatedEuclidianDistance.cpp.
float64_t compute | ( | int32_t | idx_a, | |
int32_t | idx_b | |||
) | [protected, virtual] |
compute kernel function for features a and b idx_{a,b} denote the index of the feature vectors in the corresponding feature object
Implements CRealDistance.
Definition at line 46 of file AttenuatedEuclidianDistance.cpp.
virtual bool get_disable_sqrt | ( | ) | [virtual] |
disable application of sqrt on matrix computation the matrix can then also be named norm squared
Definition at line 86 of file AttenuatedEuclidianDistance.h.
virtual EDistanceType get_distance_type | ( | ) | [virtual] |
get distance type we are
Implements CRealDistance.
Definition at line 67 of file AttenuatedEuclidianDistance.h.
virtual EFeatureType get_feature_type | ( | ) | [virtual] |
get feature type the distance can deal with
Reimplemented from CRealDistance.
Definition at line 73 of file AttenuatedEuclidianDistance.h.
virtual const char* get_name | ( | void | ) | const [virtual] |
get name of the distance
Reimplemented from CRealDistance.
Definition at line 79 of file AttenuatedEuclidianDistance.h.
init distance
l | features of left-hand side | |
r | features of right-hand side |
Reimplemented from CRealDistance.
Definition at line 36 of file AttenuatedEuclidianDistance.cpp.
virtual void set_disable_sqrt | ( | bool | state | ) | [virtual] |
disable application of sqrt on matrix computation the matrix can then also be named norm squared
state | new disable_sqrt |
Definition at line 93 of file AttenuatedEuclidianDistance.h.
bool disable_sqrt [protected] |
if application of sqrt on matrix computation is disabled
Definition at line 106 of file AttenuatedEuclidianDistance.h.