SklearnBalltreeDist#

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

Bases: DistanceAlgorithm

Distance matrix using ball tree implementation from scikit-learn.

Parameters:

Attributes Summary

name

Methods Summary

__call__(X[, Y])

Compute distance matrix.

is_symmetric()

Attributes Documentation

name: str = 'sklearn.balltree'#

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]#