# nan_euclidean_distances

### cuml.metrics.nan_euclidean_distances(X, Y=None, , squared=False, missing_values=cp.nan, copy=True)[[source]](https://github.com/NVIDIA/cuml/blob/93418baf5/python/cuml/cuml/metrics/pairwise_distances.pyx#L102)

Calculate the euclidean distances in the presence of missing values.

Compute the euclidean distance between each pair of samples in X and Y,
where Y=X is assumed if Y=None. When calculating the distance between a
pair of samples, this formulation ignores feature coordinates with a
missing value in either sample and scales up the weight of the remaining
coordinates:

> dist(x,y) = sqrt(weight \* sq. distance from present coordinates)
> where,
> weight = Total # of coordinates / # of present coordinates

For example, the distance between `[3, na, na, 6]` and `[1, na, 4, 5]`
is:

> $$
> \sqrt{\frac{4}{2}((3-1)^2 + (6-5)^2)}

> $$

If all the coordinates are missing or if there are no common present
coordinates then NaN is returned for that pair.

* **Parameters:**
  **X**
  : Acceptable formats: cuDF DataFrame, NumPy ndarray, Numba device
    ndarray, cuda array interface compliant array like CuPy.

  **Y**
  : A second feature array. If `None`, `Y` is assumed to be `X`.
    Acceptable formats: cuDF DataFrame, NumPy ndarray, Numba device
    ndarray, cuda array interface compliant array like CuPy.

  **squared**
  : Return squared Euclidean distances.

  **missing_values**
  : Representation of missing value.

  **copy**
  : Whether to make a copy of X and Y when necessary. Setting to
    False can reduce memory usage, but may result in mutation
    of X and Y.
* **Returns:**
  **distances**
  : Returns the distances between the row vectors of `X`
    and the row vectors of `Y`.

<!-- !! processed by numpydoc !! -->
