topo.utils

Submodules

Package Contents

Functions

read_pkl([wd, filename])

get_landmark_indices(data[, n_landmarks, method, ...])

subsample_square_csr_to_indices(data, indices)

get_sparse_matrix_from_indices_distances(knn_indices, ...)

get_indices_distances_from_sparse_matrix(X, n_neighbors)

Get the knn indices and distances for each point in a sparse k-nearest-neighbors matrix.

print_eval_results(evaluation_dict[, n_top])

eigsorted(cov)

get_eccentricity(emb, laplacian[, H_emb])

topo.utils.read_pkl(wd=None, filename='topograph.pkl')
topo.utils.get_landmark_indices(data, n_landmarks=1000, method='random', random_state=None, **kwargs)
topo.utils.subsample_square_csr_to_indices(data, indices)
topo.utils.get_sparse_matrix_from_indices_distances(knn_indices, knn_dists, n_obs, n_neighbors)
topo.utils.get_indices_distances_from_sparse_matrix(X, n_neighbors)

Get the knn indices and distances for each point in a sparse k-nearest-neighbors matrix.

Parameters:
  • X (sparse matrix) – Input knn matrix to get indices and distances from.

  • n_neighbors (int) – Number of neighbors to get.

Returns:

  • knn_indices (ndarray of shape (n_obs, n_neighbors)) – The indices of the nearest neighbors for each point.

  • knn_dists (ndarray of shape (n_obs, n_neighbors)) – The distances to the nearest neighbors for each point.

topo.utils.print_eval_results(evaluation_dict, n_top=3)
topo.utils.eigsorted(cov)
topo.utils.get_eccentricity(emb, laplacian, H_emb=None)