fatf.utils.distances.euclidean_point_distance¶
-
fatf.utils.distances.euclidean_point_distance(y: Union[numpy.ndarray, numpy.void], X: numpy.ndarray) → numpy.ndarray[source]¶ Calculates the Euclidean distance between
yand every row ofX.yhas to be a 1-dimensional numerical numpy array or a row of a structured numpy array (i.e. numpy’s void) andXhas to be a 2-dimensional numerical numpy array. The length ofyhas to be the same as the width ofX.- 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
yand every row ofX.
- Raises
- IncorrectShapeError
Either
yis not 1-dimensional orXis not 2-dimensional or the length ofyis not equal to the number of columns inX.- ValueError
Either of the input arrays is not purely numerical.