GClasses
GClasses::GEuclidSimilarity Class Reference

Detailed Description

This computes the reciprocal of Euclidean distance, where all missing values are simply ignored.

#include <GDistance.h>

Inheritance diagram for GClasses::GEuclidSimilarity:
GClasses::GSparseSimilarity

Public Member Functions

 GEuclidSimilarity ()
 
 GEuclidSimilarity (GDomNode *pNode)
 
virtual ~GEuclidSimilarity ()
 
virtual GDomNodeserialize (GDom *pDoc) const
 See the comment for GSparseSimilarity::serialize. More...
 
virtual double similarity (const std::map< size_t, double > &a, const std::map< size_t, double > &b)
 Computes the similarity between two sparse vectors. More...
 
virtual double similarity (const std::map< size_t, double > &a, const GVec &b)
 Computes the similarity between a sparse and a dense vector. More...
 
virtual double similarity (const GVec &a, const GVec &b)
 Computes the similarity between two dense vectors. More...
 
- Public Member Functions inherited from GClasses::GSparseSimilarity
 GSparseSimilarity ()
 
virtual ~GSparseSimilarity ()
 
void setRegularizer (double d)
 Set a regularizing term to add to the denominator. More...
 

Protected Attributes

double m_squaredMissingPenalty
 
- Protected Attributes inherited from GClasses::GSparseSimilarity
double m_regularizer
 

Additional Inherited Members

- Static Public Member Functions inherited from GClasses::GSparseSimilarity
static GSparseSimilaritydeserialize (GDomNode *pNode)
 Load from a DOM. More...
 
- Protected Member Functions inherited from GClasses::GSparseSimilarity
GDomNodebaseDomNode (GDom *pDoc, const char *szClassName) const
 A helper method used internally. More...
 

Constructor & Destructor Documentation

GClasses::GEuclidSimilarity::GEuclidSimilarity ( )
inline
GClasses::GEuclidSimilarity::GEuclidSimilarity ( GDomNode pNode)
inline
virtual GClasses::GEuclidSimilarity::~GEuclidSimilarity ( )
inlinevirtual

Member Function Documentation

virtual GDomNode* GClasses::GEuclidSimilarity::serialize ( GDom pDoc) const
virtual
virtual double GClasses::GEuclidSimilarity::similarity ( const std::map< size_t, double > &  a,
const std::map< size_t, double > &  b 
)
virtual

Computes the similarity between two sparse vectors.

Implements GClasses::GSparseSimilarity.

virtual double GClasses::GEuclidSimilarity::similarity ( const std::map< size_t, double > &  a,
const GVec b 
)
virtual

Computes the similarity between a sparse and a dense vector.

Implements GClasses::GSparseSimilarity.

virtual double GClasses::GEuclidSimilarity::similarity ( const GVec a,
const GVec b 
)
virtual

Computes the similarity between two dense vectors.

Implements GClasses::GSparseSimilarity.

Member Data Documentation

double GClasses::GEuclidSimilarity::m_squaredMissingPenalty
protected