MLPACK  1.0.4
Static Public Member Functions
mlpack::kernel::CosineDistance Class Reference

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

List of all members.

Static Public Member Functions

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

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: