MLPACK  1.0.8
Static Public Member Functions | List of all members
mlpack::kernel::CosineDistance Class Reference

The cosine distance (or cosine similarity). More...

Static Public Member Functions

template<typename VecType >
static double Evaluate (const VecType &a, const VecType &b)
 Computes the cosine distance between two points. More...
 

Detailed Description

The cosine distance (or cosine similarity).

It is defined by

\[ d(a, b) = \frac{a^T b}{|| a || || b ||} \]

and this class assumes the standard L2 inner product.

Definition at line 40 of file cosine_distance.hpp.

Member Function Documentation

template<typename VecType >
static double mlpack::kernel::CosineDistance::Evaluate ( const VecType &  a,
const VecType &  b 
)
static

Computes the cosine distance between two points.

Parameters
aFirst vector.
bSecond vector.
Returns
d(a, b).

The documentation for this class was generated from the following file: