NlpTools API
Class

NlpTools\Similarity\Euclidean

class Euclidean implements DistanceInterface

This class computes the very simple euclidean distance between two vectors ( sqrt(sum((a_i-b_i)^2)) ).

Methods

float dist(array $A, array $B)

Details

at line 17
public float dist(array $A, array $B)

Parameters

array $A Either a vector or a collection of tokens to be transformed to a vector
array $B Either a vector or a collection of tokens to be transformed to a vector

Return Value

float The euclidean distance between $A and $B