stereo.core.StPipeline.umap#

StPipeline.umap(pca_res_key='pca', neighbors_res_key='neighbors', res_key='umap', min_dist=0.5, spread=1.0, n_components=2, maxiter=None, alpha=1.0, gamma=1.0, negative_sample_rate=5, init_pos='spectral', method='umap', random_state=0, parallel=False)[source]#

Embed the neighborhood graph using UMAP [McInnes18].

Parameters:
  • pca_res_key (str) – the key of PCA analysis to get corresponding result from self.result.

  • neighbors_res_key (str) – the key of neighbors to get corresponding result from self.result.

  • res_key (str) – the key for storing result of UMAP.

  • min_dist (float) – the effective minimum distance between embedded points. Smaller values will result in a more clustered/clumped embedding where nearby points on the manifold are drawn closer together, while larger values will result on a more even dispersal of points. The value should be set relative to the spread value, which determines the scale at which embedded points will be spread out. The default of in the umap-learn package is 0.1.

  • spread (float) – the effective scale of embedded points. In combination with min_dist this determines how clustered/clumped the embedded points are.

  • n_components (int) – the number of dimensions of the embedding.

  • maxiter (Optional[int]) – the number of iterations (epochs) of the optimization. Called n_epochs in the original UMAP.

  • alpha (float) – the initial learning rate for the embedding optimization.

  • gamma (float) – weighting applied to negative samples in low dimensional embedding optimization. Values higher than one will result in greater weight being given to negative samples.

  • negative_sample_rate (int) – the number of negative edge/1-simplex samples to use per positive edge/1-simplex sample in optimizing the low dimensional embedding.

  • init_pos (str) –

    how to initialize the low dimensional embedding. Called init in the original UMAP. Options are:

    'spectral': use a spectral embedding of the graph. 'random': assign initial embedding positions at random.

  • method (str) – Use the original ‘umap’ implementation, or ‘rapids’ (experimental, GPU only)

Returns:

UMAP result is stored in self.result where the result key is 'umap'.