topo.eval.local_scores

Module Contents

Functions

geodesic_distance(A[, method, unweighted, directed, ...])

Compute the geodesic distance matrix from an adjacency (or an affinity) matrix.

knn_spearman_r(data_graph, embedding_graph[, ...])

knn_kendall_tau(data_graph, embedding_graph[, ...])

geodesic_correlation(data, emb[, landmarks, ...])

topo.eval.local_scores.geodesic_distance(A, method='D', unweighted=False, directed=False, indices=None, n_jobs=-1, random_state=None)

Compute the geodesic distance matrix from an adjacency (or an affinity) matrix. The default behavior is to subset the geodesic distance matrix to only include distances up to the k-th nearest neighbor distance for each point. This is to ensure we are only assessing the performance of the embedding on the local structure of the data.

Parameters:
  • A (array-like, shape (n_vertices, n_vertices)) – Adjacency or affinity matrix of a graph.

  • method (string, optional, default: 'D') – Method to compute the shortest path. - ‘D’: Dijkstra’s algorithm. - ‘FW’: Floyd-Warshall algorithm. - ‘B’: Bellman-Ford algorithm. - ‘J’: Johnson algorithm. - ‘F’: Floyd algorithm.

  • unweighted (bool, optional, default: False) – If True, the adjacency matrix is considered as unweighted.

  • directed (bool, optional, default: True) – If True, the adjacency matrix is considered as directed.

  • indices (array-like, shape (n_indices, ), optional, default: None) – Indices of the vertices to compute the geodesic distance matrix.

  • n_jobs (int, optional, default: 1) – The number of parallel jobs to use during search.

Returns:

geodesic_distance (array-like, shape (n_vertices, n_vertices))

topo.eval.local_scores.knn_spearman_r(data_graph, embedding_graph, path_method='D', subsample_idx=None, unweighted=False, n_jobs=1)
topo.eval.local_scores.knn_kendall_tau(data_graph, embedding_graph, path_method='D', subsample_idx=None, unweighted=False, n_jobs=1)
topo.eval.local_scores.geodesic_correlation(data, emb, landmarks=None, landmark_method='random', metric='euclidean', n_neighbors=3, n_jobs=-1, cor_method='spearman', random_state=None, return_graphs=False, verbose=False, **kwargs)