maxfuse.graph.construct_graph
- maxfuse.graph.construct_graph(arr, randomized_svd=False, svd_runs=1, svd_components=None, n_neighbors=15, metric='correlation', verbose=False)[source]
Compute k-nearest neighbors of data and return the UMAP graph.
- Parameters:
arr (np.array of shape (n_samples, n_features)) – Data matrix
randomized_svd (bool, default=False) – Whether to use randomized svd.
svd_runs (int, default=1) – Randomized SVD will result in different runs, so if randomized_svd=True, perform svd_runs many randomized SVDs, do one iteration of refinement, and pick the one with the smallest average distance of matched pairs as the starting point. If randomized_svd=False, svd_runs is forced to be 1.
svd_components (None or int) – If None, then do not do SVD, else, number of components to keep when doing SVD de-noising for the data matrix.
n_neighbors (int) – Number of neighbors desired
metric (string, default='correlation') – Metric used when constructing the initial knn graph
verbose (bool, default=True) – Whether to print progress
- Returns:
rows, cols, vals (list) – Each edge is rows[i], cols[i], and its weight is vals[i]