RDist#

class datafold.pcfold.distance.RDist(cut_off, kmin=None, metric='euclidean', **backend_options)[source]#

Bases: DistanceAlgorithm

Sparse distance matrix algorithm rdist, for point clouds with manifold assumption.

Note

The dependency on the Python package is optional. The package is currently not published.

Parameters:
  • metric – “euclidean” or “sqeuclidean”

  • cut_off – Distance values (always Euclidean metric) that are larger are not stored in distance matrix.

Raises:

ImportError – if rdist is not installed, but selected as backend

References

Todo

include own paper if published

Attributes Summary

name

Methods Summary

__call__(X[, Y])

Compute distance matrix.

is_symmetric()

Attributes Documentation

name: str = None#

Methods Documentation

__call__(X, Y=None)[source]#

Compute distance matrix.

Parameters:
  • X (ndarray) – Reference dataset of shape (n_samples_X, n_features).

  • Y (Optional[ndarray]) – Query dataset of shape (n_samples_Y, n_features). If set then the computation is component-wise and if None, the reference dataset is taken as the query points (i.e. Y=X).

Returns:

distance matrix

Return type:

scipy.sparse.csr_matrix

classmethod is_symmetric()[source]#