GClasses
|
Interpolates between manhattan distance (norm=1), Euclidean distance (norm=2), and Chebyshev distance (norm=infinity). For nominal attributes, Hamming distance is used. More...
#include <GDistance.h>
Public Member Functions | |
GLNormDistance (double norm) | |
GLNormDistance (GDomNode *pNode) | |
virtual GDomNode * | serialize (GDom *pDoc) |
See the comment for GDistanceMetric::serialize. | |
virtual void | init (sp_relation &pRelation) |
See the comment for GDistanceMetric::init. | |
virtual double | squaredDistance (const double *pA, const double *pB) const |
Returns the distance (using the norm passed to the constructor) between pA and pB. | |
void | setDiffWithUnknown (double d) |
Specify the difference to use when one or more of the values is unknown. (If your data contains unknown values, you may want to normalize the known values to fall within some pre-determined range, so that it will be possible to select a reasonable value for this purpose.) | |
Protected Attributes | |
double | m_norm |
double | m_diffWithUnknown |
Interpolates between manhattan distance (norm=1), Euclidean distance (norm=2), and Chebyshev distance (norm=infinity). For nominal attributes, Hamming distance is used.
GClasses::GLNormDistance::GLNormDistance | ( | double | norm | ) |
GClasses::GLNormDistance::GLNormDistance | ( | GDomNode * | pNode | ) |
virtual void GClasses::GLNormDistance::init | ( | sp_relation & | pRelation | ) | [virtual] |
See the comment for GDistanceMetric::init.
Implements GClasses::GDistanceMetric.
See the comment for GDistanceMetric::serialize.
Implements GClasses::GDistanceMetric.
void GClasses::GLNormDistance::setDiffWithUnknown | ( | double | d | ) | [inline] |
Specify the difference to use when one or more of the values is unknown. (If your data contains unknown values, you may want to normalize the known values to fall within some pre-determined range, so that it will be possible to select a reasonable value for this purpose.)
virtual double GClasses::GLNormDistance::squaredDistance | ( | const double * | pA, |
const double * | pB | ||
) | const [virtual] |
Returns the distance (using the norm passed to the constructor) between pA and pB.
Implements GClasses::GDistanceMetric.
double GClasses::GLNormDistance::m_diffWithUnknown [protected] |
double GClasses::GLNormDistance::m_norm [protected] |