fatf.utils.distances.euclidean_point_distance

fatf.utils.distances.euclidean_point_distance(y, X)[source]

Calculates the Euclidean distance between y and every row of X.

y has to be a 1-dimensional numerical numpy array or a row of a structured numpy array (i.e. numpy’s void) and X has to be a 2-dimensional numerical numpy array. The length of y has to be the same as the width of X.

Parameters
yUnion[numpy.ndarray, numpy.void]

A numpy array (has to be 1-dimensional and purely numerical) used to calculate distances from.

Xnumpy.ndarray

A numpy array (has to be 2-dimensional and purely numerical) to which rows distances are calculated.

Returns
distancesnumpy.ndarray

An array of Euclidean distances between y and every row of X.

Raises
IncorrectShapeError

Either y is not 1-dimensional or X is not 2-dimensional or the length of y is not equal to the number of columns in X.

ValueError

Either of the input arrays is not purely numerical.