GClasses
|
The base class for similarity metrics that operate on sparse vectors.
#include <GDistance.h>
Public Member Functions | |
GSparseSimilarity () | |
virtual | ~GSparseSimilarity () |
virtual GDomNode * | serialize (GDom *pDoc) const =0 |
Marshal this object into a DOM, which can then be converted to a variety of serial formats. More... | |
void | setRegularizer (double d) |
Set a regularizing term to add to the denominator. More... | |
virtual double | similarity (const std::map< size_t, double > &a, const std::map< size_t, double > &b)=0 |
Computes the similarity between two sparse vectors. More... | |
virtual double | similarity (const std::map< size_t, double > &a, const GVec &b)=0 |
Computes the similarity between a sparse and a dense vector. More... | |
virtual double | similarity (const GVec &a, const GVec &b)=0 |
Computes the similarity between two dense vectors. More... | |
Static Public Member Functions | |
static GSparseSimilarity * | deserialize (GDomNode *pNode) |
Load from a DOM. More... | |
Protected Member Functions | |
GDomNode * | baseDomNode (GDom *pDoc, const char *szClassName) const |
A helper method used internally. More... | |
Protected Attributes | |
double | m_regularizer |
|
inline |
|
inlinevirtual |
|
protected |
A helper method used internally.
|
static |
Load from a DOM.
Marshal this object into a DOM, which can then be converted to a variety of serial formats.
Implemented in GClasses::GEuclidSimilarity, GClasses::GPearsonCorrelation, and GClasses::GCosineSimilarity.
|
inline |
Set a regularizing term to add to the denominator.
|
pure virtual |
Computes the similarity between two sparse vectors.
Implemented in GClasses::GEuclidSimilarity, GClasses::GPearsonCorrelation, and GClasses::GCosineSimilarity.
|
pure virtual |
Computes the similarity between a sparse and a dense vector.
Implemented in GClasses::GEuclidSimilarity, GClasses::GPearsonCorrelation, and GClasses::GCosineSimilarity.
|
pure virtual |
Computes the similarity between two dense vectors.
Implemented in GClasses::GEuclidSimilarity, GClasses::GPearsonCorrelation, and GClasses::GCosineSimilarity.
|
protected |